PDA

View Full Version : RGBE texture loading



capedica
06-13-2005, 12:48 AM
Hi,
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
,GL_FLOAT,image);


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

roffe
06-14-2005, 06: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?

capedica
06-14-2005, 06: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...

Overmind
06-15-2005, 12:31 AM
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...

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