15 #include <QOpenGLShaderProgram>
16 #include <QOpenGLBuffer>
17 #include <QOpenGLVertexArrayObject>
41 virtual void update(
float t);
51 virtual void resize(
int width,
int height);
59 virtual void rotateAzimuth(
float t);
61 virtual void rotatePolar(
float t);
65 bool m_bContourEnabled;
66 bool m_bContourConstant;
67 bool m_bAmbientOcclusion;
68 bool m_bShadowEnabled;
69 float m_fContourDepthFactor;
70 float m_fContourWidth;
71 float m_fAmbientFactor;
72 float m_fDiffuseFactor;
73 float m_fSpecularFactor;
75 float m_fAmbientIntensity;
79 virtual void setAmbientFactor(
float ambientFactor);
81 virtual void setDiffuseFactor(
float diffuseFactor);
83 virtual void setSpecularFactor(
float specularFactor);
85 virtual void setNearPlane(
float nearPlane);
87 virtual void setFarPlane(
float farPlane);
89 virtual void setAmbientOcclusion(
bool value);
91 virtual void setContourEnabled(
bool value);
93 virtual void setContourConstant(
bool value);
95 virtual void setDepthFactor(
float depthFactor);
97 virtual void setContourWidth(
float width);
99 virtual void setAmbientIntensity(
float value);
101 virtual void setShadowEnabled(
bool value);
103 virtual void switchAmbientOcclusionQuality(
int quality);
124 bool loadModelFromPath(
const std::string absoluteFilePath);
130 void createSamplingDirections();
138 void createSamplingViewMatrices();
140 void createShadowCamera();
142 int m_bAmbientOcclusionQuality;
143 int mSamplingDirectionsSize;
144 std::vector<glm::vec3> mSamplingDirectionsLow;
145 std::vector<glm::vec3> mSamplingDirectionsMedium;
146 std::vector<glm::vec3> mSamplingDirectionsHigh;
147 std::vector<glm::mat4> mSamplingViewMatrices;
148 glm::mat4 mSamplingProjectionMatrix;
150 glm::vec3 m_LightDir;
152 GLuint m_VBO_AmbientOcclusion;
153 GLuint m_Texture_DepthMap;
154 GLuint m_Texture_AmbientOcc;
160 GLuint m_ShaderID_DepthMap;
161 GLuint m_ShaderID_AmbOccl;
168 glm::mat4 m_projMatrix;
169 glm::mat4 m_modelViewMatrix;
171 glm::mat4 m_ShadowProjMatrix;
172 glm::mat4 m_ShadowViewMatrix;
Definition: abstractscene.h:17
virtual void update(float t)
Overrides the abstract method in AbstractScene.
Definition: scene.cpp:147
Class for a ShaderManager.
virtual void compileShader()
Overrides the abstract method in AbstractScene.
Definition: scene.cpp:112
Scene()
Default constructor.
Definition: scene.cpp:57
Abstract class for a scene.
Definition: ShaderManager.hpp:13
virtual void initialize()
Overrides the abstract method in AbstractScene.
Definition: scene.cpp:88
virtual void resize(int width, int height)
Overrides the abstract method in AbstractScene.
Definition: scene.cpp:160
Definition: ModelLoader.hpp:19
virtual void render()
Overrides the abstract method in AbstractScene.
Definition: scene.cpp:152
void renderAmbientOcclusion()
Renders the ambient occlusion effect.
Definition: scene.cpp:245