I am rendering a 128 bit float texture in a pbuffer. After rendering the image I load it to a texture with glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, window_width, window_height, 0);
Then I am generating an automatic mipmap from it. After that I would like to read the textures generated on every mip-map level.
However when I use glGetTexImage I am getting float values clamped to [0…1]. How can I deal with this problem?
If anyone knows how to tell GL not to clamp texture color data, please reply.
Blade the Voyager
Specify the type field to be GL_UNSIGNED_BYTE and you should get the info you desire.
If you want data packed in anything other than bytes per component then ask for that. Keep the outgoing format the same as the native format for best performance.
I don’t think the automatic MIP map generation supports floats, for the same reason that you don’t get any filtering with floating-point textures.
Does your top level return anything other than clamped values? If not, how are you sure you’re actually getting float internal format?
I am using an ATI extension to ensure 32 floating point precision in my textures:
GL_RGB_FLOAT32_ATI as internal format.
At first I am generating a texture name.
Then I am binding it to a texture object
to create the actual texture from a float array.
Internalformat is GL_RGB_FLOAT32_ATI, and format is GL_RGB. Is that what is wrong?
Yours sincerely: Blade