PeriDyno 1.0.0
Loading...
Searching...
No Matches
ShadowMap.h
Go to the documentation of this file.
1
16
17#pragma once
18
23#include "GraphicsObject/Mesh.h"
24
25#include <vector>
26#include <RenderEngine.h>
27
28namespace dyno
29{
30 class Camera;
31 class SceneGraph;
32
34 {
35 public:
36 ShadowMap(int size = 1024);
37 ~ShadowMap();
38
39 void initialize();
40 void release();
41
42 void update(dyno::SceneGraph* scene, const dyno::RenderParams& rparams);
43
44 // bind uniform block and texture
45 void bind(int shadowUniformLoc = 3, int shadowTexSlot = 5);
46
47 int getSize() const;
48 void setSize(int size);
49
50 int getNumBlurIterations() const;
51 void setNumBlurIterations(int iter);
52
53 private:
54 // framebuffers
59
62
63
64 Buffer mShadowUniform; // uniform buffer for shadow lookup matrices
65
66 bool sizeUpdated = false;
67 int size = -1;
68
69 // num of blur interations for VSM
70 int blurIters = 1;
71
72 public:
73
74 // patch to color bleeding, min p_max
75 float minValue = 0.1f;
76 };
77}
void setNumBlurIterations(int iter)
void update(dyno::SceneGraph *scene, const dyno::RenderParams &rparams)
Framebuffer mFramebuffer
Definition ShadowMap.h:55
Texture2D mShadowDepth
Definition ShadowMap.h:57
void bind(int shadowUniformLoc=3, int shadowTexSlot=5)
int getNumBlurIterations() const
int getSize() const
ShadowMap(int size=1024)
Definition ShadowMap.cpp:19
Texture2D mShadowTex
Definition ShadowMap.h:56
Texture2D mShadowBlur
Definition ShadowMap.h:58
Buffer mShadowUniform
Definition ShadowMap.h:64
void setSize(int size)
Program * mBlurProgram
Definition ShadowMap.h:60
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
int scene
Definition GltfFunc.h:20