View Full Version : RGBE texture loading

06-12-2005, 11:48 PM
i'm loading rgbe texture in this way:

float* image;
f = fopen(nome,"rb");
RGBE_ReadHeader(f,&image_width,&image_height,NULL) ;
image = (float *)malloc(sizeof(float)*3*image_width*image_height) ;
RGBE_ReadPixels_RLE(f,image,image_width,image_heig ht);
then i create a 2d texture:

glTexImage2D(GL_TEXTURE_2D,0,GL_RGB32F_ARB,width,h eight,0,GL_RGB

Now i'm using it as normal texture but it doesn't function, do i have to change RC's pixel format? or is there something else?
Thank you

06-14-2005, 05:19 AM
Explain what isn't working. Are you using shaders? Rendering to fixed-point fb causes clamping. Maybe you are rendering to floating-point framebuffers/pbuffers?

06-14-2005, 05:53 AM
Thank you for your answer but i've resolved i think, the problem was that rgbe image was not power of two.
If i use float texture that are not power of two (even empty texture) frame rate goes down to 1 fps (i think opengl switch to software mode), if i use texture that are power of two frame rate is normal (200 fps). I'm using an ati card, i don't know if it is normal this behavior...

06-14-2005, 11:31 PM
ATI cards don't support the ARB_texture_npot extension fully, so for OpenGL 2.0 compatibility they have to fall back to software when using NPOT textures under centain conditions.

I don't know the exact restrictions of NPOT textures on ATI hardware, but I think at least mipmapping is not allowed...

06-15-2005, 03:20 PM
Yes, and GL_REPEAT isn't either.