Hi,

jake chambers wrote:
Hi,

Thanks for the replies. Brian: when I set the nodemask on the main camera to zero it no longer renders, which is good, but the FBO no longer gets rendered (I get a totally black image in the associated osg::Image).
JP: If I just insert my FBO into the scene (as POST_RENDER) two things happen 
when I render a frame: I get the correct image in my FBO, but the main camera 
also renders. I want to be able to choose if the the main camera should render 
or not when the FBO is in use.

I'm still confused about what you actually want to do. Would it be OK if the main camera image is just empty? If so, if you add the scene to your FBO camera (make it pre_render) and add only the node containing the FBO camera to your main camera, the main camera should render nothing (you should get the clearcolor) when you call viewer.frame(). The main camera would only render the scene if a scene is attached to it, it won't render the FBO camera's scene.


I looked at osgautocapture, but it doesn't do what I need to do because the 
main camera always renders (and has to as the saved image comes from a 
DrawCallback on the main camera).

Also see osgscreencapture and grep for screencapturehandler.

jp


I've also tried simply putting my fbo directly into the viewer with:

savedcam=osgviewer->getCamera()
osgviewer->setCamera(myfbo)
osgviewer->renderingTraversals()
osgviewer->setCamera(savedcam)

But when I do this not only do I not get an image in my FBO, but the viewer 
(with the normal camera) no longer renders afterwards.

I suspect a workable solution would be to create a duplicate Viewer, setup with 
only an FBO as the main camera, and which shares the scene  (and database 
pager, etc) with the first Viewer. Then when I need to save screenshot(s) I can 
just explicitly render with the second Viewer. But surely such a drastic 
solution shouldn't be necessary?

Thank you!

Cheers,
jake

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=16120#16120





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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

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

Reply via email to