I was trying to use osg::Image::readImageFromCurrentTexture() to read back a 
texture from the GPU. The glGetTexImage() call was failing because it was using 
an invalid pixel format. The pixel format that it uses comes from calling 
osg::Image::computePixelFormat() with the internal format of the texture as 
input. In this case my texture's internal format was GL_RGBA8, which 
computePixelFormat() incorrectly returns GL_RGBA8. It should return GL_RGBA. I 
also tried GL_RGBA16 and had the same experience. Probably just need to add:

case GL_RGBA8:
case GL_RGBA16:
                return GL_RGBA;

to the switch statement in computePixelFormat() to fix the problem.

Alex
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to