Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-15 Thread Fred Smith
Hi JP, As soon as I attach an image, OSG crashes on me. The problem arises in FrameBufferObject::Pimpl::Pimpl. Code: // This code crashes osg::Texture2D *texture = new osg::Texture2D(); texture->setTextureSize(1024, 1024); texture->setInternalFormat(GL_DEPTH24_ST

Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-15 Thread J.P. Delport
Hi Fred, we've also encountered cases (float formats) where we need to call: void setInternalTextureFormat(GLint internalFormat); after allocateImage in the case of using Images to read back data. If you look at allocateImage code, you'll see why. Can you check if this works for you without

Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-14 Thread Fred Smith
This looks like an OSG bug to me. The code is in osg\Texture2D.cpp, in Texture2D::apply. With PACKED_DEPTH_STENCIL_BUFFER, internalFormat should be GL_DEPTH24_STENCIL8_EXT, format should be GL_DEPTH_STENCIL_EXT and type GL_UNSIGNED_INT_24_8_EXT. The current OSG 2.8 code makes this GL_DEPTH_STE

Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-14 Thread Fred Smith
I've also tried with an image: Code: Image *pdsImage = new Image(); pdsImage->allocateImage(256, 256, 1, GL_DEPTH24_STENCIL8_EXT, GL_UNSIGNED_INT_24_8_EXT, 1); camera->attach(PACKED_DEPTH_STENCIL_BUFFER, pdsImage); This code results in the following error and then the application crashes. err

Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-14 Thread Fred Smith
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.op

Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-12 Thread Frederic Bouvier
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

Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-12 Thread Fred Smith
Hi Fred, Frederic Bouvier wrote: > > I doubt it is possible to read back the stencil buffer, and attach it to a > texture. > Then how can I read back stencil buffer data? Thanks, Fred -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32659#3265

Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-12 Thread Frederic Bouvier
Hi Fred, - "Fred Smith" a écrit : > The following works fine: > > camera->attach(osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, > GL_DEPTH_STENCIL_EXT); > > Why doesn't it work if I create a texture? I need to create a texture > and an image, as I want to retrieve stencil buffer data after frame

Re: [osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-12 Thread Fred Smith
The following works fine: camera->attach(osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, GL_DEPTH_STENCIL_EXT); Why doesn't it work if I create a texture? I need to create a texture and an image, as I want to retrieve stencil buffer data after frame() has been called. Cheers, Fred --

[osg-users] Stencil buffer and FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT

2010-10-11 Thread Fred Smith
Hi, I've got the following 2 errors when frame() is called, when I've got a stencil buffer attached to my camera: RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6 Warning: detected OpenGL error 'invalid enumerant' at end of SceneView::draw() My RTT code looks like this: Cod