ComputerGraphik TU WIEN
sunVolumetric.hpp
Go to the documentation of this file.
1 #ifndef SUNVOLUMETRIC_HPP
2 #define SUNVOLUMETRIC_HPP
3 
4 #include "sceneObject.hpp"
5 
6 #include <memory>
7 #include <vector>
8 #include <GL/glew.h>
9 #include <glm/vec3.hpp>
10 #include <glm/mat4x4.hpp>
11 #include <glm/mat4x4.hpp>
12 #include <glm/gtc/matrix_transform.hpp>
13 
14 class SunVolumetric: public SceneObject {
15 public:
16 
17  SunVolumetric(const std::string& name, Scene* scene = 0, Model* model = 0, const glm::mat4& modelMatrix = glm::mat4(1.0f));
18  virtual ~SunVolumetric();
19 
20  void firstPass();
21  void draw() const;
22  void reset();
23  void postProcess();
24  GLuint getFrameBufferTexture() { return colorTexture; }
25  glm::vec4 getScreenLightPos() { return ScreenLightPos; }
26 
27 private:
29  friend class EffectObjectVolumetric;
31  friend class EffectObjectVolumetricPost;
32 
33  bool isInScreen;
34  int texWidth;
35  int texHeight;
36 
37  GLuint frameBuffer;
38  GLuint depthTexture;
39  GLuint colorTexture;
40 
42 
43  glm::vec4 ScreenLightPos;
44 
45  void setUpDepthTexture();
46  void setUpColorTexture();
47  void screenTest();
48  void switchShader(Shader* newShader);
49 };
50 
51 #endif //SUNVOLUMETRIC_HPP
Definition: sunVolumetric.hpp:14
int texHeight
Definition: sunVolumetric.hpp:35
void postProcess()
Definition: sunVolumetric.cpp:338
Encapsulates a graphical object model in the GPU.
Definition: model.hpp:14
virtual ~SunVolumetric()
Definition: sunVolumetric.cpp:136
GLuint depthTexture
Definition: sunVolumetric.hpp:38
Model * model
Definition: sceneObject.hpp:69
GLuint getFrameBufferTexture()
Definition: sunVolumetric.hpp:24
void screenTest()
Definition: sunVolumetric.cpp:173
void draw() const
Definition: sunVolumetric.cpp:226
Model * quadModel
Definition: sunVolumetric.hpp:41
Definition: sunVolumetric.cpp:55
int texWidth
Definition: sunVolumetric.hpp:34
glm::vec4 getScreenLightPos()
Definition: sunVolumetric.hpp:25
void setUpColorTexture()
Definition: sunVolumetric.cpp:140
Encapsulates the Rendering Engine, holds a complete scene and it's assets.
Definition: scene.hpp:71
GLuint colorTexture
Definition: sunVolumetric.hpp:39
Scene * scene
Definition: sceneObject.hpp:68
glm::vec4 ScreenLightPos
Definition: sunVolumetric.hpp:43
void firstPass()
Definition: sunVolumetric.cpp:256
bool isInScreen
Definition: sunVolumetric.hpp:33
std::string name
Definition: sceneObject.hpp:73
glm::mat4 modelMatrix
Definition: sceneObject.hpp:71
Encapsulates a shader program.
Definition: shader.hpp:9
GLuint frameBuffer
Definition: sunVolumetric.hpp:37
The base class of the objects which are rendered.
Definition: sceneObject.hpp:30
SunVolumetric(const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1.0f))
Definition: sunVolumetric.cpp:103
Definition: sunVolumetric.cpp:15
void setUpDepthTexture()
Definition: sunVolumetric.cpp:158
void switchShader(Shader *newShader)
Definition: sunVolumetric.cpp:306
void reset()
Definition: sunVolumetric.cpp:204