Developer Documentation
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. More...
 
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. More...
 
void resolveStereoAnyglyph (int _viewerID)
 Resolve stereo buffers as anaglyph. More...
 

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 59 of file PostProcessing.hh.

Member Function Documentation

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 235 of file PostProcessing.cc.

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 457 of file PostProcessing.cc.

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 76 of file PostProcessing.cc.


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