Commit 708524fb authored by Christopher Tenter's avatar Christopher Tenter

- update stereo rendering

- change interface for postprocessing to allow multiple inputs

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19687 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4f2724ca
......@@ -55,11 +55,11 @@
struct PostProcessorInput
{
PostProcessorInput(GLuint colTex = 0,
GLuint depthTex = 0,
int width = 0,
int height = 0)
: colorTex_(colTex), depthTex_(depthTex), width(width), height(height) {}
PostProcessorInput(GLuint _colTex = 0,
GLuint _depthTex = 0,
int _width = 0,
int _height = 0)
: colorTex_(_colTex), depthTex_(_depthTex), width(_width), height(_height) {}
GLuint colorTex_;
GLuint depthTex_;
......@@ -68,6 +68,25 @@ struct PostProcessorInput
};
struct PostProcessorOutput
{
PostProcessorOutput(GLuint _fbo = 0,
GLuint _drawBuffer = 0,
int _width = 0,
int _height = 0)
: fbo_(_fbo), drawBuffer_(_drawBuffer), width(_width), height(_height) {}
// opengl fbo id
GLuint fbo_;
// draw target of fbo: GL_BACK, GL_FRONT, GL_COLOR_ATTACHMENT0..
GLuint drawBuffer_;
int width, height;
};
/** \brief Interface to add global image post processor functions from within plugins.
*
* \ref postProcessorInterfacePage "Detailed description"
......@@ -88,7 +107,7 @@ class PostProcessorInterface {
/** \brief post processor function
*
*/
virtual void postProcess(ACG::GLState* _glState, const PostProcessorInput& _input, GLuint _targetFBO = 0) {};
virtual void postProcess(ACG::GLState* _glState, const std::vector<const PostProcessorInput*>& _input, const PostProcessorOutput& _output) = 0;
/** \brief announce name for the postProcessor function
*
......@@ -96,6 +115,15 @@ class PostProcessorInterface {
*/
virtual QString postProcessorName() = 0;
/** \brief does post processor resolve stereo buffer
*
* The post processor gets the left and right image as input and composes a combined stereo output.
*
* @return true if implementation resolves stereo buffer, false otherwise
*/
virtual bool isStereoProcessor() {return false;}
/** \brief Return options menu
*
* If you want an options Menu or menu entry, you can return your action here.
......
This diff is collapsed.
......@@ -539,7 +539,8 @@ private:
void drawScene_mono();
/// helper function for setting the projection mode of the coordinate system node
void setCoordSysProjection(glViewer::ProjectionMode _mode);
/// draw the cursor
void drawCursor();
......@@ -1078,6 +1079,37 @@ private:
//===========================================================================
/** @name Stereo rendering
* @{ */
//===========================================================================
private:
ACG::FBO stereoFBO_[2];
/** \brief Compute left and right eye projection matrix for stereo rendering
*
* @param _width viewport width
* @param _height viewport height
* @param _properties viewer props
* @param _outLeft [out] projection matrix for left eye
* @param _outRight [out] projection matrix for right eye
*/
void computeProjStereo(int _width, int _height,
Viewer::ViewerProperties& _properties,
ACG::GLMatrixd* _outLeft, ACG::GLMatrixd* _outRight);
/** \brief Update target fbos for stereo rendering
*
* @param _width viewport width
* @param _height viewport height
*/
void updateStereoFBOs(int _width, int _height);
/** @} */
//===========================================================================
/** @name Post Processing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment