SuzanneIsland: An island of Real-time rendering effects!
Public Member Functions
SSAOEffect Class Reference

The SSAOEffect class facilitates Screen Space Ambient Occlusion using a two pass rendering pipeline, where in the first pass the screen colors and other information are rendered to textures to allow for postprocessing, and in the second pass the postprocessed texture is rendered to a screen filling quad. More...

#include <ssao_effect.h>

Public Member Functions

 SSAOEffect (int windowWidth, int windowHeight, int samples_)
 
void setupFramebuffers (int windowWidth, int windowHeight)
 setup framebuffers and their screen filling texture or renderbuffer attachments More...
 
void bindScreenDataFramebuffer ()
 bind framebuffer in which screen colors and view space vertex positions should be stored for ssao postprocessing. More...
 
void calulateSSAOValues (const glm::mat4 &projMat)
 calulate the resulting ssao factors for each fragment and store it in a texture attached to the fboSSAO More...
 
void bindSSAOResultTexture (GLint ssaoTexShaderLocation, GLuint textureUnit)
 bind the texture which stores the ssao results after calulateSSAOValues to given shader locaton and texture unit More...
 
void blurSSAOResultTexture ()
 

Detailed Description

The SSAOEffect class facilitates Screen Space Ambient Occlusion using a two pass rendering pipeline, where in the first pass the screen colors and other information are rendered to textures to allow for postprocessing, and in the second pass the postprocessed texture is rendered to a screen filling quad.

Constructor & Destructor Documentation

§ SSAOEffect()

SSAOEffect::SSAOEffect ( int  windowWidth,
int  windowHeight,
int  samples_ 
)

SETUP SCREEN FILLING QUAD setup vao for the screen quad onto which the screen texture will be mapped.

SETUP FRAMEBUFFERS setup framebuffers with texture or renderbuffer objects as attachments

  • texture: optimized for later sampling (e.g. for postprocessing)
  • renderbuffer object: optimized for use as render target, less flexible

SETUP SSAO SHADER compile shader programs and pass random vectors to ssao shader used for depth sampling. other uniforms are passed to ssao shader each frame and are not included here.

Member Function Documentation

§ bindScreenDataFramebuffer()

void SSAOEffect::bindScreenDataFramebuffer ( )

bind framebuffer in which screen colors and view space vertex positions should be stored for ssao postprocessing.

after binding this, execute the required draw calls using appropriate shaders.

§ bindSSAOResultTexture()

void SSAOEffect::bindSSAOResultTexture ( GLint  ssaoTexShaderLocation,
GLuint  textureUnit 
)

bind the texture which stores the ssao results after calulateSSAOValues to given shader locaton and texture unit

Parameters
ssaoTexShaderLocationthe shader location
textureUnitthe texture unit

§ calulateSSAOValues()

void SSAOEffect::calulateSSAOValues ( const glm::mat4 &  projMat)

calulate the resulting ssao factors for each fragment and store it in a texture attached to the fboSSAO

Parameters
projMatthe projection matrix to use in the render pipeline this needs certain information rendered to textures after binding via the bindScreenDataFramebuffer.

§ setupFramebuffers()

void SSAOEffect::setupFramebuffers ( int  windowWidth,
int  windowHeight 
)

setup framebuffers and their screen filling texture or renderbuffer attachments

Parameters
windowWidthbuffer width
windowHeightbuffer height

The documentation for this class was generated from the following files: