Developer Documentation
|
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 | |
Definition at line 53 of file PostProcessing.hh.
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.
_viewerID | OpenFlipper viewer id (viewport index) |
_modelview | modelview matrix of the scene |
_proj1 | projection matrix 1 (left eye in stereo mode) |
_proj2 | projection matrix 2 (right eye in stereo mode) |
_hwOpenGLStereo | hardware stereo support should be used to resolve the stereo buffers (GL_BACK_LEFT, GL_BACK_RIGHT) |
Definition at line 229 of file PostProcessing.cc.
void PostProcessing::resolveStereoAnyglyph | ( | int | _viewerID | ) |
Resolve stereo buffers as anaglyph.
Final textures are combined to an anaglyph image.
_viewerID | OpenFlipper viewer id (viewport index) |
Definition at line 451 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.
_viewerID | OpenFlipper viewer id (viewport index) |
_width | texture width |
_height | texture height |
_samples | number of samples for multisampling |
_stereoEye | eye from which to render the scene: -1 (no stereo rendering), 0 (left eye), 1 (right eye) |
Definition at line 70 of file PostProcessing.cc.