PDA

View Full Version : save greater-than-one float in texture!!solved!!!!



shapeare
07-16-2011, 12:46 AM
I saved some values in a matrix, and want to use the matrix to initialize a texture.

Some of the values in the matrix are greater than one, and they are all in floating format.

The texture is generated using the following code:


glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, imageWidth,
imageHeight, 0, GL_RGBA, GL_FLOAT, myMatrix);


However, when I use gDEBugger to check the value saved in the texture, only to find that all values are less than one. Why? How to solve this problem?

_arts_
07-16-2011, 02:14 AM
Try RGBA32F as internal format (or RGBA32F_ARB)

shapeare
07-16-2011, 05:40 AM
Thank you very much. It is correct now.