The CullVisitor traverses the scene graph and assembles a render graph. The
structure of the render graph is composed of RenderBins, some of which might
actually be RenderStages.
The current RenderBin changes under two circumstances:
- The CullVisitor encounters a Node with a StateSet whose RenderBin details
require a different RenderBin.
- The CullVisitor encounters a Camera, or some custom Node that calls into the
CullVisitor to change the RenderBin.
The CullVisitor contains built-in support for Camera. The CullVisitor changes
the RenderBin to the Camera's RenderStage during CullVisitor::apply(Camera&).
If you want to derive a class from RenderStage and insert it into the render
graph, you can do that with a custom Node class. But because CullVisitor doesn't
know about your custom Node, you must overrides Node::traverse(). In that
method, call into the CullVisitor to set your custom RenderStage. I have done
this before, and it does work. Most recently, I used a custom RenderStage to
implement depth peeling in which occlusion query was used to determine the
number of passes.
You might also be able to insert a custom RenderStage by editing the render
graph directly, perhaps with an osgViewer Operation. I have never tried this
approach.
There is no way to "register" a RenderStage for Cameras to use, as far as I
know. But as you already know, you can do this with RenderBin. So if you don't
require any of the functionality of RenderStage, then perhaps a custom RenderBin
would suffice.
Hope this helps,
-Paul
On 1/2/2013 1:01 AM, Aurelien Albert wrote:
Hi,
I use differents custom RenderStages : as pre-renderstage for pre-processing
and as post-renderstage for post processing.
These processing are executed using FBO render targets.
Currently I'm doing that with slaves cameras, but :
- the "RenderStage" class is derived from the "RenderBin" class
- it is possible to register new RenderBins using the
"addRenderBinPrototype" method
So I wonder if it is possible to create a new RenderStage prototype to replace
my slave cameras ?
How to configure the rendertarget of these renderstages ?
My goal here is to learn how to create / customize RenderStages and RenderBins.
Thank you!
Cheers,
Aurelien
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51746#51746
_______________________________________________
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