Hello everyone. I'm trying to use an RTT camera to write both the color buffer and the stencil buffer into textures. I tried this:
Code: // Create texture the color buffer will be written to osg::Texture2D* buffer = new osg::Texture2D(); buffer->setTextureSize(_w, _h); buffer->setInternalFormat(GL_RGB); // Create texture the stencil buffer will be written to osg::Texture2D* stencil = new osg::Texture2D(); stencil->setTextureSize(_w, _h); stencil->setInternalFormat(GL_DEPTH_STENCIL_EXT); // Attach both textures to camera camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); camera->attach(osg::Camera::COLOR_BUFFER, buffer, 0, 0, false, 0, 0); camera->attach(osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, stencil, 0, 0, false, 0, 0); It produces an error "RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6". I took a look at the osgpackeddepthstencil example. It does this: Code: camera->attach(osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, GL_DEPTH_STENCIL_EXT); instead of this: Code: camera->attach(osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, stencil, 0, 0, false, 0, 0); So I tried it and it didn't produce any error. But then I have no idea what my stencil buffer is attached to. How do I read it ? How do I use it ? Regards, Nicolas ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63217#63217 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org