Hello Johannes, Johannes Brunen wrote: > one color buffer either as RenderBuffer or as TextureBuffer > a depth buffer either as RenderBuffer or as TextureBuffer > a stencil buffer either as RenderBuffer or as TextureBuffer
ok, I'm not sure if the depth/stencil formats are allowed for textures, those may have to be always RenderBuffers. > I got compiler errors can you post the errors please? oh, nvm I see the annotations below now. > and I'm not sure about the texture part for a depth / > stencil scenario. I have not understand how I should setup the > GL_DEPTH24_STENCIL8 scenario. Additionally, the GL_DEPTH24_STENCIL8 symbol > is not defined. Should it be added to OSGGLEXT.h? hm, it should come from your systems OpenGL headers, you can get newer versions of glext.h from this page <http://www.opengl.org/documentation/specs/>, see the end of first section. > My code... [SNIP] > if (depth && !stencil) { // only depth buffer > if (depth_stencil_texture) { > TextureBufferUnrecPtr buffer = genTextureBuffer(width, height); > buffer->setInternalFormat(GL_DEPTH_COMPONENT24); // error: > interface doesn't exist yes, sine the TextureBuffer always has a TextureObj, the internal format is taken from there. A RenderBuffer may not even have an image (it's only needed if you want to download the data to main mem) so there needs to be a separate way to specify the format. [SNIP] > } else > if (depth && stencil) { // depth buffer + stencil buffer > if (depth_stencil_texture) { > TextureBufferUnrecPtr buffer = genTextureBuffer(width, height); > buffer->setInternalFormat(GL_DEPTH24_STENCIL8); // error: > interface doesn't exist > _fbo->setDepthAttachment(buffer); // error ? hm, dunno. What is the error about? > _fbo->setStencilAttachment(buffer); > } else { > RenderBufferUnrecPtr buffer = OSG::RenderBuffer::create(); > buffer->setInternalFormat(GL_DEPTH24_STENCIL8); // error: > symbol unknown newer glext.h should help with this. > _fbo->setDepthAttachment(buffer); > _fbo->setStencilAttachment(buffer); > } > } > if (!depth && stencil) { // no depth buffer but stencil buffer > ??? is this possible i guess it is possible, and is the reason there is a separate stencil attachment at all. Not sure how useful it is and since it is a rather exotic case there might also be driver bugs along this route ;) > Gerrit has provided this line of GL code in another thread: > > http://www.mail-archive.com/opensg-users@lists.sourceforge.net/msg13160.html > > glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8_EXT, > 512, 512, 0, GL_DEPTH_STENCIL_EXT, > GL_UNSIGNED_INT_24_8_EXT, NULL); > > What is the place I have to provide the GL_DEPTH24_STENCIL8_EXT and > GL_DEPTH_STENCIL_EXT parameters in my setup? GL_DEPTH24_STENCIL8_EXT is the internal format of the texture, GL_DEPTH_STENCIL_EXT is the external format of the texture, both are set on the TextureObjChunk. GL_UNSIGNED_INT_24_8_EXT is the Image's data type. Cheers, Carsten ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users