Hi Jon, I can't work out exactly what you are trying to achieve with your render "offscreen". So could you please from a high level explain what effect you are trying to achieve.
Robert. On Fri, Jun 13, 2008 at 1:07 AM, Goldman, Jon <[EMAIL PROTECTED]> wrote: > Hi, > > I am somewhat new to OpenSceneGraph. For my project we need to render > "offscreen" -- so that overlapping windows do not corrupt the rendered image. > We are using osg::Camera::FRAME_BUFFER_OBJECT render implementation, and > getting the core behaviour we want, which is to say that we can extract the > correctly rendered pixels from the image attached to the camera/frame buffer > object. > > However, I still have two issues, and a question on performance: > > 1) The on-screen window is not showing the rendered image. Instead it is > filled with garbage (or black) pixels. The question is what is the best way > to reflect the contents of the fbo image? Should we do as osgprerender > example does and create some geometry (osg::Geometry) and then texturemap the > image onto the surface, or is there another (better?) way to push the pixels > into the framebuffer so that the on-screen window displays properly? > > 2) using osg::Camera::PIXEL_BUFFER_RTT render implementation crashes on our > system. We are running 32-bit Windows XP with dual SLI-graphics NVIDIA 5600 > cards. I didn't spend a lot of time on this problem, mainly wondering if > others are seeing the same? > > 3) Question: Any recommendation(s) on ways to increase/maximize performance > when using fbo? > > > Here is a code snippet showing how we are currently setting up the fbo: > > . > . > . > osg::Image * fboImage = new osgImage(); > fboImage->allocateImage( width, height, 1, GL_RGB, GL_UNSIGNED_BYTE); > > wc->cameraPostRenderCB = new WindowCapturePostDrawCallback(wc->getView(), > fboImage, NULL); > > // attach the image so it's copied on each frame. > > theCamera->attach( osg::Camera::COLOR_BUFFER, fboImage); > > osg::Camera::RenderTargetImplementation renderImplementation; > renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; > > // tell the camera to use OpenGL frame buffer object where supported. > theCamera->setRenderTargetImplementation(renderImplementation); > > // set the post render callback > theCamera->setPostDrawCallback(wc->cameraPostRenderCB); > . > . > . > > > Thanks, > -Jon Goldman > Sandia National Laboratories > Albuquerque, New Mexico > > > _______________________________________________ > 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

