SuzanneIsland: An island of Real-time rendering effects!
ssao_effect.h
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <iostream>
6 
7 #include <GL/glew.h>
8 #include <GLFW/glfw3.h>
9 #include <glm/glm.hpp>
10 #include <glm/gtc/type_ptr.hpp>
11 
12 #include "../shader.h"
13 
14 
22 {
23  GLuint fboScreenData, screenColorTexture, viewPosTexture, screenDepthBuffer;
24  GLuint fboSSAO, ssaoTexture;
25  GLuint fboSSAOBlurPingpong, ssaoBlurredTexturePingpong;
26 
27  GLuint screenQuadVAO, screenQuadVBO;
28 
29  Shader *ssaoShader = nullptr;
30  Shader *blurShader = nullptr;
31 
32  GLuint samples; // reference uses 64 [increase for better quality]
33 
37  void drawQuad();
38 
39 public:
40  SSAOEffect(int windowWidth, int windowHeight, int samples_);
41  ~SSAOEffect();
42 
48  void setupFramebuffers(int windowWidth, int windowHeight);
49 
55 
62  void calulateSSAOValues(const glm::mat4 &projMat);
63 
70  void bindSSAOResultTexture(GLint ssaoTexShaderLocation, GLuint textureUnit);
71 
72  void blurSSAOResultTexture();
73 
74 private:
75 };
76 
void bindScreenDataFramebuffer()
bind framebuffer in which screen colors and view space vertex positions should be stored for ssao pos...
Definition: ssao_effect.cpp:190
Shader class.
Definition: shader.h:15
SSAOEffect(int windowWidth, int windowHeight, int samples_)
Definition: ssao_effect.cpp:15
The SSAOEffect class facilitates Screen Space Ambient Occlusion using a two pass rendering pipeline...
Definition: ssao_effect.h:21
void setupFramebuffers(int windowWidth, int windowHeight)
setup framebuffers and their screen filling texture or renderbuffer attachments
Definition: ssao_effect.cpp:106
void calulateSSAOValues(const glm::mat4 &projMat)
calulate the resulting ssao factors for each fragment and store it in a texture attached to the fboSS...
Definition: ssao_effect.cpp:198
void bindSSAOResultTexture(GLint ssaoTexShaderLocation, GLuint textureUnit)
bind the texture which stores the ssao results after calulateSSAOValues to given shader locaton and t...
Definition: ssao_effect.cpp:245