[osg-users] Multi-pass rendering in OSG

Art Tevs stud_info2 at yahoo.de
Wed Sep 17 10:55:22 PDT 2008


Hi Bryan,

take a look into osgPPU. It does exactly what you are looking for.

Cheers,
art



--- Thrall, Bryan <bryan.thrall at flightsafety.com> schrieb am Mi, 17.9.2008:

> Von: Thrall, Bryan <bryan.thrall at flightsafety.com>
> Betreff: [osg-users] Multi-pass rendering in OSG
> An: "OpenSceneGraph Users" <osg-users at lists.openscenegraph.org>
> Datum: Mittwoch, 17. September 2008, 16:38
> 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...):
> 
> Root
> |->Camera(PRE_RENDER)
> ||->Model
> |->Camera(POST_RENDER)
> ||->Pass 1 quad
> ||->Camera(POST_RENDER)
> |||->Pass 2 quad
> |||->Camera(POST_RENDER)
> ||||->Pass 3 quad
> ||||->Camera(POST_RENDER)
> |||||->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?
> 
> Thanks,
> --
> Bryan Thrall
> FlightSafety International
> bryan.thrall at flightsafety.com
>  
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 



More information about the osg-users mailing list