Hi Eric, Its really hard for me to actually guess what is going wrong without having an example that I can step through in front of me. My best guess for looking at the code is the setting of the RenderOrder on the FBO camera being inappropriate, try dropping this.
Another means to get this resolved would be to add a snapshot functional like your have implemenent in osgviewerCocoa on one of the other examples that runs on other platforms, this way I can at least try it out on my system and debug it. Robert. On 7/27/07, E. Wing <[EMAIL PROTECTED]> wrote: > This is kind of a follow up to something awhile back. I'm trying to > fix up the screenshot feature in the osgviewerCocoa example which > broke when migrating away from SimpleViewer. > > I was told that instead of manipulating the scene graph nodes to > insert my own camera at the top of the scene to setup an FBO to get a > screenshot, I could just try using the Master camera that belongs to > osg::View. > > So I'm finally trying that and gutted all my old camera code, but I > must be missing something because now I only get a solid black image > when I try it. > > Basically my code is: > // Setup camera for FBO > osg::Camera* root_camera = theViewer->getCamera(); > osg::Camera::RenderOrder old_render_order = > root_camera->getRenderOrder(); > root_camera->setRenderOrder(osg::Camera::PRE_RENDER); > > root_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); > root_camera->attach(osg::Camera::COLOR_BUFFER, osg_image.get()); > > // Render > theViewer->frame(); > // not sure if I need to flush??? > glFlush(); > > // Restore camera to original settings > root_camera->detach(osg::Camera::COLOR_BUFFER); > root_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER); > root_camera->setRenderOrder(old_render_order); > > // Do something with osg_image, but it's currently solid black. > > Any suggestions on how to fix this? > > Thanks, > Eric > _______________________________________________ > 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

