Frederic Bouvier wrote: > Maybe : > > textureDepthStencil->setInternalFormat( GL_DEPTH_STENCIL_EXT ); > ... > camera->attach(osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, textureDepthStencil); > > Could work. As the depth and stencil buffer are packed, so should the texture. > (re)read http://www.opengl.org/registry/specs/EXT/packed_depth_stencil.txt > > there is a paragraph that starts with : > In addition, a new base internal format, GL_DEPTH_STENCIL_EXT, can > be used by both texture images and renderbuffer storage. When an > image with a DEPTH_STENCIL_EXT internal format is attached to both > the depth and stencil attachment points of a framebuffer object (see > EXT_framebuffer_object), then it becomes both the depth and stencil > buffers of the framebuffer...
I modified the osgpackeddepthstencil sample the following way and it just doesn't work. Code: if(usePDS) { osg::Texture2D *textureDS = new osg::Texture2D; textureDS->setTextureSize(1024, 1024); textureDS->setInternalFormat(GL_DEPTH_STENCIL_EXT); rttCamera->attach(osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, textureDS); } I'm using the latest nVidia drivers on Windows 7 x64 and OSG 2.8. When looking things up with an OpenGL tracer (I used glslDevil here) the error is generated upon the following call made by OSG: Code: glTexImage2D(GL_TEXTURE_2D, 0, 34041, 1024, 1024, 0, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_BYTE, 00000000) OpenGL error GL_INVALID_ENUM detected 34041 = 0x84F9 = GL_DEPTH_STENCIL_NV according to GLew.h Is this a bug, or am I doing something wrong? ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32735#32735 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org