ComputerGraphik TU WIEN
shadowMap.hpp
Go to the documentation of this file.
1 #ifndef SHADOWMAP_HPP
2 #define SHADOWMAP_HPP
3 
4 #include <vector>
5 #include <glm/vec3.hpp>
6 #include <glm/vec4.hpp>
7 #include <glm/mat4x4.hpp>
8 
9 #include "light.hpp"
10 
12 
26 class ShadowMap : public Light
27 {
28 public:
29  ShadowMap(const std::string& name, Scene* scene = 0, Model* model = 0, const glm::mat4& modelMatrix = glm::mat4(1));
30  virtual ~ShadowMap();
31 
32  void draw() const;
33  void reset();
34  void update(double deltaT);
35  void setShader(Shader* val);
36 
37  glm::mat4 getDepthMVP() const { return depthMVP; }
38  glm::mat4 getDepthBiasMVP() const { return depthBiasMVP; }
39  GLuint getDepthTexture() const { return depthTexture; }
40 
41 private:
42  class EffectObject;
43 
44  GLuint frameBuffer;
45  GLuint depthTexture;
46  glm::mat4 depthMVP;
47  glm::mat4 depthBiasMVP;
48 };
49 
50 #endif //SHADOWMAP_HPP
Encapsulates a graphical object model in the GPU.
Definition: model.hpp:14
void update(double deltaT)
Definition: shadowMap.cpp:141
glm::mat4 depthBiasMVP
Definition: shadowMap.hpp:47
glm::mat4 depthMVP
Definition: shadowMap.hpp:46
Definition: shadowMap.cpp:16
Used for further implementations of light in the scene (Sun is a direct derivation).
Definition: light.hpp:16
Model * model
Definition: sceneObject.hpp:69
void setShader(Shader *val)
Definition: shadowMap.cpp:156
GLuint frameBuffer
Definition: shadowMap.hpp:42
GLuint depthTexture
Definition: shadowMap.hpp:45
glm::mat4 getDepthMVP() const
Definition: shadowMap.hpp:37
Implementation of the shadow map effect.
Definition: shadowMap.hpp:26
Encapsulates the Rendering Engine, holds a complete scene and it's assets.
Definition: scene.hpp:71
Scene * scene
Definition: sceneObject.hpp:68
void reset()
Definition: shadowMap.cpp:121
virtual ~ShadowMap()
Definition: shadowMap.cpp:72
void draw() const
Definition: shadowMap.cpp:78
std::string name
Definition: sceneObject.hpp:73
glm::mat4 modelMatrix
Definition: sceneObject.hpp:71
Encapsulates a shader program.
Definition: shader.hpp:9
GLuint getDepthTexture() const
Definition: shadowMap.hpp:39
ShadowMap(const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1))
Definition: shadowMap.cpp:46
glm::mat4 getDepthBiasMVP() const
Definition: shadowMap.hpp:38