PDA

View Full Version : using GL_FLOAT for texture targets



paintor
03-26-2004, 02:39 PM
This might be a beginner question, i figured you guys would probably know more on the subject,

when calling a glTexImageXD routine with a load of floats, specifying GL_FLOAT as the data type to use, what actually happens, how does GL map the float range and use it ??

do negative values get ignored ?

Thanks

Chris

jwatte
03-26-2004, 03:01 PM
In basic OpenGL, the texture is typically converted in the driver to unsigned 8 bits precision, and clamped to the [0,1] range.

In extensions for the latest cards, you may get other behavior, if you request extended, floating-point formats.

paintor
03-26-2004, 03:09 PM
Thanks,

im using new hardware, fx5900 or r9700 and above. if i specify RGBA16 for internal format, in a glTexImageXD operation, i guess i'll get 16 bit precision clamped to [0,1]. Does anybody know how these values are mapped ? or should i use an extension such as float_buffer instead to guarantee behaviour ?

thanks for the help

cass
03-26-2004, 03:20 PM
There are two formats.

The external one, that includes both "format" and "type" and tells the driver how to cast and interpret the void * data argument.

Then there's an internal format (like RGB8 or INTENSITY32F), and that determines what sort of type conversions and component replicating or merging need to happen.

Note also that the internal format is strictly a hint.

Thanks -
Cass