Hi Kenzo,

On 11 October 2012 22:07, Kenzo Lespagnol <[email protected]> wrote:
> From your answer I understand that I should have a slave camera which render 
> the scene to texture and then doing my post processing from this slave 
> camera. To disable my post-process I should only remove slave cameras.

You can disable a Camera by setting it's NodeMask to 0 i.e.

  slaveCamera->setNodeMask(0x0);

And then to re-enable it:

  slaveCamera->setNodeMask(0xffffffff);

This won't release any of it's resources though, it'll just sittle
there doing nothing.  Removing a Camera completely from the View will
potentially release the resources if no other part of the
viewer/scenegraph share them.

> By this mean I'm not modifying my master camera (which render to framebuffer) 
> but what I have is a black screen.
>
> Am I using osg correctly?

It's just too hard to know without actually sitting in front the code
and running the application, in principle it sounds like you shouldn't
be too far from getting things to work.  For getting a black screen it
would suggest there isn't a Camera rendering to the window so perhaps
there is something amiss here.


> Also I had tested to set rendering cache to 0, but it doesn't work. My main 
> camera seems not using rendering cache as it is already set to 0.

If the main camera isn't doing any rendering it'self it won't need any
rendering backend data strucutre so the cache will be 0.  When the
viewer is set up one assigns the windows and the osgViewer::Renderer
gets assigned.  The Renderer is an active operation that actually runs
the cull and draw traversals for the threads that the viewer manages.
The RenderingCache is passive data structure (a osgUtil::RenderStage)
that gets assigned/ and reused in CullVisitor and is used for RTT
Camera in the scene graph.

Robert.

Robert.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to