[osg-users] Multi-pass rendering in OSG
jpdelport at csir.co.za
Wed Sep 17 08:38:52 PDT 2008
have a look at the osgstereomatch example, there is a multi-pass algo
example. See the readme of that too.
Also search the list archives for osgPPU.
Thrall, Bryan wrote:
> I'm attempting to implement a multiple pass rendering algorithm in OSG,
> but I'm not sure what the best way is. I am just learning how to do this
> and how to use Frame Buffer Objects. I initially tried to implement an
> osgFX::Effect, since it supports multiple passes transparently. The
> problem is how to pass the data between the passes.
> The algorithm is to render the model to a texture, then process that
> texture over 3 passes and composite it back into the scene. I used the
> osgprerender example to do the first part using
> osg::Camera::FRAME_BUFFER_OBJECT without problems. I then tried to use
> osg::FrameBufferObject to pass the data from the first processing pass
> to the second, but it doesn't work. It looks, from
> osgUtil::RenderStage's Camera support, like osg::FrameBufferObject can't
> be used simply by adding it to a StateSet, but it needs
> glCheckFrameBufferStatusEXT after the apply(). Is this a limitation of
> osg::FrameBufferObject, or am I missing something?
> My current attempt is to use nested osg::Cameras with
> osg::Camera::POST_RENDER for each pass, like so (hoping the ASCII art
> turns out...):
> ||->Pass 1 quad
> |||->Pass 2 quad
> ||||->Pass 3 quad
> |||||->Final pass quad
> At each pass, the texture target from the Camera's FBO is used to
> texture the quad for the next pass (with shaders attached to the next
> pass's StateSet to do the processing).
> Is this a recommended approach? Are there any requirements on the
> Cameras (Transform values, ABSOLUTE_RF, etc.) I should be configuring?
> Bryan Thrall
> FlightSafety International
> bryan.thrall at flightsafety.com
> osg-users mailing list
> osg-users at lists.openscenegraph.org
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
More information about the osg-users