Try setting the main camera node mask to 0 when you don't want it to render and 0xffffffff when you do.
Brian This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. • [email protected] wrote: ----- To: OpenSceneGraph Users <[email protected]> From: "J.P. Delport" <[email protected]> Sent by: [email protected] Date: 08/11/2009 10:15AM Subject: Re: [osg-users] Turning off main osgViewer camera Hi, sorry I might have answered too fast. What do you want the main camera to render when you are taking screenshots? What is it rendering when when you only attach the FBO camera? AFAIK you still need to call viewer frame() to trigger the FBO, but you can make the main camera just render nothing. If you want to run an FBO camera without creating a window, then consider the pbuffer option for the main frame buffer. See also maybe the osgscreencapture example. jp J.P. Delport wrote: > Hi, > > have a look at the osgautocapture example. Set the main camera to render > offscreen, pbuffer. > > jp > > jake chambers wrote: >> Hi, >> >> I have an application where I setup a "normal" osgViewer view with >> setUpViewOnSingleScreen(). This works fine. >> >> I also create an FBO camera to which I add my scene. When I want to >> take a screenshot of the application I call >> osgviewer->setSceneData(myFBOCamera) and render via >> osgviewer->eventTraversal() / updateTraversal() / >> renderingTraversals(). After I get the screenshot I restore my normal >> scene with osgviewer->setSceneData(mySceneData). This also works fine >> for taking screenshots. >> >> What I want to do now is to turn off the "main" camera whilst I render >> the FBO (ie if I create a lot of screenshots for a movie I don't want >> to render to the screen). How can I turn off the main camera and >> render only to the FBO? >> I've tried calling osgviewer->setCamera(NULL) without sucess. Indeed >> when I meddle with the main camera I dont get a valid image from my >> FBO. I think this makes sense as the FBO is under the main camera(?). >> I also tried calling osgviewer->setCamera(myFBO) but no luck that way >> either. I also can't restore the original camera to the osgviewer. >> >> Perhaps I am solving the problem the wrong way - is there a better >> method? Perhaps having two seperate osgViewer objects? But then I >> think I have only one conceptual "View" (my FBO always shows the same >> view as the main camera, it's only a question of if the main camera >> should render an image or not), so having one Viewer, one View and two >> Cameras feels correct - it's just that it doesn't work :-) >> >> >> Thank you! >> >> Cheers, >> jake >> >> ------------------ >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=16079#16079 >> >> >> >> >> >> _______________________________________________ >> 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 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

