Hi Marcel,

The scheme to avoid rendering a camera multiple times in one frame
exists to avoid redundant passes being done.  I have to admit that
your setup is convoluted enough that I can't really follow it from a
quick read.   Given I don't understand your approach well enough I
can't pinpoint the best way forward.

In general I'd say that if you need multiple passes that each produce
a different output then you'll need multiple RTT Camera's rather than
one that is shared.  The way to manage this would be to have a custom
Node or cull callback that decides which of a set of RTT Camera to
traversal for each pass.  You can use do it without a cull
callback/custom node if you set up traversal masks for each pass so
that you can ensure that only the appropriate RTT Camera is traversed
for each pass.

Robert.


On 22 May 2013 19:41, Marcel Pursche
<[email protected]> wrote:
> Hi,
>
> I found the cause of the problem myself. When the scene graph is traversed a 
> osgUtil::RenderStage is created for the camera and added to the RenderCache 
> of the camera. So only one RenderStage per CullVisitor is created. When the 
> RenderStage is drawn it sets a flag that is was already drawn this frame.
> So no matter how often you add a camere to the scene graph, it's scene is 
> only rendered once. This optimization makes sence in most cases, but in my 
> special case it would be great if I could turn it off.
>
> I currently have two solutions for this problem:
>
> 1. A PostDrawCallback that resets the RenderStage flag by accessing the 
> RenderCache of the current camera. This solution is extremly ugly. I had to 
> copy the interal osg class osgUtil::RenderingCache because it is in no header 
> file. A very bad hack: If the code of this class changes or the compiler 
> creates a different memory layout(different optimizations turned on etc.) the 
> dynamic_cast from osg::Object to osgUtil::RenderingCache can go terribly 
> wrong.
>
> 2. Create a shallow copy of the virtual texturing scene graph. The root node 
> and pre render camera is copied while the subgraph with the geometry is 
> reused. The pre render pass with its callbacks will be called per depth 
> peeling pass as expected and the waste of memory is not that big.
>
> I will implement the second solution because the first one is obviously not 
> the way to go if I don't want to run in stability issues.
>
>
> Thank you!
>
> Cheers,
> Marcel
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=54109#54109
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to