Hi Frank,

If you nest a Camera below another Camera it operates within the the
parent Camera's RenderStage (the RenderStage is the rendering
back-ends way of managing what to draw each frame), and if it's
assigned as a PRE_RENDER then it'll be drawn before the main body of
the context of the parent Camera, if it's POST_RENDER then it's drawn
after.  If you use NESTED_RENDER then the contents of the child Camera
will just be treated as normal subgraph save for the changes in
projection and view matrices and will just be placed within the main
body of the parents RenderStage.

This arrangement enables complex render to texture schemes where you
can have multiple RTT Camera's nested within other RTT Camera and
still have all the correct results produced, an example of this in
action is the way the impostors are implemented.

This is a bit different than your proposed scheme where the parent
gets rendered first for a NESTED_RENDER, but such a scheme would break
the encapsulation of subgraphs that can be achieved with the present
scheme.  To have a subgraph drawn after it's parent you simply use
POST_RENDER.  If you don't care for the order then simply have sibling
RTT Camera share the same RenderOrder parameters.

Robert.

On 6 February 2013 19:47, Frank Sullivan <knarf.navil...@gmail.com> wrote:
> Thank you, Paul and Robert.
>
> Just as a suggestion, it may be useful to have a way for NESTED_RENDER 
> ordered cameras to render to a texture. It's my understanding, from looking 
> at the code and from past forum posts, that NESTED_RENDER cameras ignore the 
> camera RTT stuff. I was hoping that attaching an FBO to a StateSet below the 
> camera would be a useful way to compel a NESTED_RENDER camera to switch over 
> to a new FBO.
>
> The reason I bring it up is that it would make setting the render order on 
> these cameras brainless -- if camera A needs to render before camera B, then 
> one can simply place camera A as an ancestor of camera B, and not have to 
> worry about setting an explicit render order number. This could be useful for 
> systems that have data-driven pipelines where you have multiple passes over 
> multiple scenes, that are required to happen in a specific order.
>
> Thanks again!
> Frank
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=52445#52445
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to