Developer Documentation
Loading...
Searching...
No Matches
PostProcessing Class Reference

Public Member Functions

int numProcessors () const
 Number of post processors.
 
int setupScene (int _viewerID, int _width, int _height, int _samples=0, int _stereoEye=-1)
 Bind fbo for scene rendering.
 
void postProcess (int _viewerID, ACG::GLState *_glstate, const ACG::GLMatrixd &_modelview, const ACG::GLMatrixd &_proj1, const ACG::GLMatrixd &_proj2, bool _hwOpenGLStereo=false)
 Perform all post processing.
 
void resolveStereoAnyglyph (int _viewerID)
 Resolve stereo buffers as anaglyph.
 

Private Member Functions

void setupFBO (ACG::FBO *_dst, int _width, int _height, GLuint _intfmt, int _samples)
 
void resolveMultisampling (ACG::FBO *_dst, ACG::FBO *_src)
 

Private Attributes

int debugLevel_
 perform extra checks for debugging: 0 -> no checks, 1 -> fast checks, 2 -> more checks etc.
 
ACG::FBO sceneFBO_ [2]
 FBO for scene rendering, one for each eye in stereo mode, possibly multisampled.
 
ACG::FBO procFBO_ [2]
 post-processing read/write FBOs, no msaa
 
ACG::FBO stereoFBO_ [2]
 store post processing results for each stereo eyes, input for anaglyph processor, no msaa
 
GLuint backbufferFBO_
 backbuffer output, not owned by this class
 
GLuint backbufferTarget_
 
GLint backbufferViewport_ [4]
 
bool stereoMode_
 postprocessing in stereo mode
 

Detailed Description

Definition at line 53 of file PostProcessing.hh.

Constructor & Destructor Documentation

◆ PostProcessing()

PostProcessing::PostProcessing ( )

Definition at line 57 of file PostProcessing.cc.

◆ ~PostProcessing()

PostProcessing::~PostProcessing ( )
virtual

Definition at line 64 of file PostProcessing.cc.

Member Function Documentation

◆ postProcess()

void PostProcessing::postProcess ( int  _viewerID,
ACG::GLState _glstate,
const ACG::GLMatrixd _modelview,
const ACG::GLMatrixd _proj1,
const ACG::GLMatrixd _proj2,
bool  _hwOpenGLStereo = false 
)

Perform all post processing.

Post processors might require modelview and projection matrix. In stereo mode, the post processor chain is executed for each eye separately. The resulting stereo buffers for each eye have to be resolved either by hardware OpenGL support or by manually calling resoleStereoAnaglyph() afterwards.

Parameters
_viewerIDOpenFlipper viewer id (viewport index)
_modelviewmodelview matrix of the scene
_proj1projection matrix 1 (left eye in stereo mode)
_proj2projection matrix 2 (right eye in stereo mode)
_hwOpenGLStereohardware stereo support should be used to resolve the stereo buffers (GL_BACK_LEFT, GL_BACK_RIGHT)

Definition at line 229 of file PostProcessing.cc.

◆ resolveMultisampling()

void PostProcessing::resolveMultisampling ( ACG::FBO _dst,
ACG::FBO _src 
)
private

Definition at line 405 of file PostProcessing.cc.

◆ resolveStereoAnyglyph()

void PostProcessing::resolveStereoAnyglyph ( int  _viewerID)

Resolve stereo buffers as anaglyph.

Final textures are combined to an anaglyph image.

Parameters
_viewerIDOpenFlipper viewer id (viewport index)

Definition at line 451 of file PostProcessing.cc.

◆ setupFBO()

void PostProcessing::setupFBO ( ACG::FBO _dst,
int  _width,
int  _height,
GLuint  _intfmt,
int  _samples 
)
private

Definition at line 193 of file PostProcessing.cc.

◆ setupScene()

int PostProcessing::setupScene ( int  _viewerID,
int  _width,
int  _height,
int  _samples = 0,
int  _stereoEye = -1 
)

Bind fbo for scene rendering.

Setup fbo and draw buffer as target for scene rendering. Some post processing effects require special targets and setupScene() takes this into account.

Parameters
_viewerIDOpenFlipper viewer id (viewport index)
_widthtexture width
_heighttexture height
_samplesnumber of samples for multisampling
_stereoEyeeye from which to render the scene: -1 (no stereo rendering), 0 (left eye), 1 (right eye)
Returns
negative (unchanged fbo ie. use current hardware fbo), 0 (fail), 1 (fbo has been changed)

Definition at line 70 of file PostProcessing.cc.

Member Data Documentation

◆ backbufferFBO_

GLuint PostProcessing::backbufferFBO_
private

backbuffer output, not owned by this class

Definition at line 127 of file PostProcessing.hh.

◆ backbufferTarget_

GLuint PostProcessing::backbufferTarget_
private

Definition at line 128 of file PostProcessing.hh.

◆ backbufferViewport_

GLint PostProcessing::backbufferViewport_[4]
private

Definition at line 129 of file PostProcessing.hh.

◆ debugLevel_

int PostProcessing::debugLevel_
private

perform extra checks for debugging: 0 -> no checks, 1 -> fast checks, 2 -> more checks etc.

Definition at line 114 of file PostProcessing.hh.

◆ procFBO_

ACG::FBO PostProcessing::procFBO_[2]
private

post-processing read/write FBOs, no msaa

Definition at line 120 of file PostProcessing.hh.

◆ sceneFBO_

ACG::FBO PostProcessing::sceneFBO_[2]
private

FBO for scene rendering, one for each eye in stereo mode, possibly multisampled.

Definition at line 117 of file PostProcessing.hh.

◆ stereoFBO_

ACG::FBO PostProcessing::stereoFBO_[2]
private

store post processing results for each stereo eyes, input for anaglyph processor, no msaa

Definition at line 123 of file PostProcessing.hh.

◆ stereoMode_

bool PostProcessing::stereoMode_
private

postprocessing in stereo mode

Definition at line 132 of file PostProcessing.hh.


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