On Wed, 5 Jul 2006, Brad Colbert wrote:
Robert and all,
I think the details with Eric's problem are at the root of the problem I
reported earlier that when performing "render to image" with a camera,
that the image is be forced into an RGBA (8bit) format, even when I am
trying to capture a 16bit float format.
Is this something we could all get resolved before the 1.1 release?
-Brad
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:osg-users-
[EMAIL PROTECTED] On Behalf Of Eric Sokolowsky
Sent: Wednesday, July 05, 2006 6:14 AM
To: osg users
Subject: Re: [osg-users] OpenSceneGraph-1.1 Release Candidate this
week
I am working with the code that reads a texture back from the
graphics card, osg::Image::readImageFromCurrentTexture(). When I read
a texture from the graphics system into a new Image object (one that
had not previously been filled with another method) some of the
parameters are incorrect. I am trying to determine what the
difference is between Image::_pixelFormat and
Image::_internalTextureFormat. Can you explain the difference? Also,
Image::_packing was not previously set by this routine, so I added a
call to glGetIntegerv(GL_UNPACK_ALIGNMENT, &packing). The existing
call to glGetTexLevelParameteriv(textureMode, 0,
GL_TEXTURE_INTERNAL_FORMAT, &internalformat) was occurring too late,
so it was moved earlier.
I have determined that when reading a texture back, Image::_pixelFormat
and Image::_internalTextureFormat should be set to the same value, which
is obtained with a call to glGetTexLevelParameteriv(textureMode, 0,
GL_TEXTURE_INTERNAL_FORMAT, ...). That is fine. But I still haven't
found a way to get the pixel format from OpenGL. Perhaps we need to add
something to the osg::State to track this.
BTW, the set of images I was having trouble with were not a multiple of
four in size. OpenGL will report an error when trying to use a
compressed texture with glTexSubImage2D() if the subloaded texture is
not of a multiple of four in both dimensions. Is this something that
should be checked for by OSG? I have a workaround in my application that
will disable texture compression on images that are not a multiple of
four in size.
--
____ __ Eric Sokolowsky (GST) NASA Goddard Space Flight Center
/ __/__/_/__ Visualization Programmer Scientific Visualization Studio
/ __/ _/ / _/ 301.286.3751 Mailstop 610.3 Bldg 28 Rm E102
/___/_//_/__/ [EMAIL PROTECTED] Greenbelt, MD 20771
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/