ComputerGraphik TU WIEN
sun.hpp
Go to the documentation of this file.
1 #ifndef SUN_HPP
2 #define SUN_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 
22 class Sun : public Light
23 {
24 public:
25 
27  Sun(const std::string& name, Scene* scene = 0, Model* model = 0, Shader* shader = 0, const glm::mat4& modelMatrix = glm::mat4(1));
28  virtual ~Sun();
29 
30  void draw() const;
31  void reset();
32  void update(double deltaT);
33  void setShader(Shader* val);
34 
35  void drawOmni() const;
36  void setUpAmbientPass();
37  void ambientPass();
38  void SVPass();
39 
40  void setUpColorTexture();
41  void setUpDepthTexture();
42  GLuint getDepthTexture() const { return depthTexture; }
43 
44 private:
46  friend class EffectObjectAmbientPass;
48  friend class EffectObjectSVPass;
50  friend class EffectObjectCube;
52  friend class EffectObjectCubeInstanced;
53 
54  GLuint frameBuffer;
55  GLuint depthTexture;
56  GLuint colorTexture;
57  GLuint cubeTexture;
58 
59  std::vector<glm::mat4> viewMatrices;
60 
62  GLenum cubeFaces[6];
63 
64  void setViewMatrices();
65 };
66 
67 #endif //SUN_HPP
void update(double deltaT)
Definition: sun.cpp:417
void setViewMatrices()
Definition: sun.cpp:572
std::vector< glm::mat4 > viewMatrices
Definition: sun.hpp:59
Definition: sun.cpp:170
Encapsulates a graphical object model in the GPU.
Definition: model.hpp:14
GLuint frameBuffer
Definition: sun.hpp:54
Used for further implementations of light in the scene (Sun is a direct derivation).
Definition: light.hpp:16
void setUpAmbientPass()
Definition: sun.cpp:457
Model * model
Definition: sceneObject.hpp:69
GLuint cubeTexture
Definition: sun.hpp:57
Definition: sun.cpp:74
void setUpDepthTexture()
Definition: sun.cpp:342
Definition: sun.cpp:219
void setUpColorTexture()
Definition: sun.cpp:324
int renderPasses
Definition: sun.hpp:61
virtual ~Sun()
Definition: sun.cpp:317
void reset()
Definition: sun.cpp:379
void draw() const
Definition: sun.cpp:562
GLuint colorTexture
Definition: sun.hpp:56
Encapsulates the Rendering Engine, holds a complete scene and it's assets.
Definition: scene.hpp:71
Scene * scene
Definition: sceneObject.hpp:68
GLuint getDepthTexture() const
Definition: sun.hpp:42
std::string name
Definition: sceneObject.hpp:73
glm::mat4 modelMatrix
Definition: sceneObject.hpp:71
Encapsulates a shader program.
Definition: shader.hpp:9
void setShader(Shader *val)
Definition: sun.cpp:567
void ambientPass()
Definition: sun.cpp:482
GLenum cubeFaces[6]
Definition: sun.hpp:62
void SVPass()
Definition: sun.cpp:502
Shader * shader
Definition: sceneObject.hpp:70
Definition: sun.hpp:22
Definition: sun.cpp:20
Sun(const std::string &name, Scene *scene=0, Model *model=0, Shader *shader=0, const glm::mat4 &modelMatrix=glm::mat4(1))
Construct new sun.
Definition: sun.cpp:286
GLuint depthTexture
Definition: sun.hpp:55
void drawOmni() const
Definition: sun.cpp:422