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 modification to Texture2D.cpp?

rgds
jp

On 14/10/10 17:55, Fred Smith wrote:
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_STENCIL_EXT,
GL_DEPTH_STENCIL_EXT and GL_UNSIGNED_BYTE. This is incorrect, hence
the driver returns GL_INVALID_ENUM.

To make the osgpackeddepthstencil sample work as desired, with the
code modification mentionned at the beginning of this thread,
Texture2D.cpp can be modified this way:


Code: if (_internalFormat == 6408) // GL_RGBA glTexImage2D(
GL_TEXTURE_2D, 0, _internalFormat, _textureWidth, _textureHeight,
_borderWidth, _sourceFormat ? _sourceFormat : _internalFormat,
_sourceType ? _sourceType : GL_UNSIGNED_BYTE, 0); else glTexImage2D(
GL_TEXTURE_2D, 0, 0x88F0, // GL_DEPTH24_STENCIL8_EXT, _textureWidth,
_textureHeight, _borderWidth, 0x84F9, // GL_DEPTH_STENCIL_EXT,
0x84FA, // GL_UNSIGNED_INT_24_8_EXT, 0);


Of course the code above is just a dirty modification just for
testing purposes, but it does work.

------------------ Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32762#32762





_______________________________________________ osg-users mailing
list osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to