PDA

View Full Version : Got a 128 bit texture mipmapped. How can I load it back into an array?



Blade the Voyager
02-09-2004, 11:22 AM
Hello Everyone!

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.

Yours sincerely:
Blade the Voyager

dorbie
02-09-2004, 02:49 PM
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.

jwatte
02-09-2004, 03:04 PM
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?

Blade the Voyager
02-12-2004, 01:08 PM
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.
glGenTextures()
Then I am binding it to a texture object
glBindTexture()
And
glTexImage2D()
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