PDA

View Full Version : Nvidia,float texture help



capedica
09-30-2005, 05:55 AM
Hi, i was using float texture on Ati with success, then i've tried on Nvidia and nothing is right. On ati i simply define a float texture in this way:
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB32F_ARB,t->whidth,t->height,0,GL_RGB,GL_FLOAT,t->pixmapF);
On nvidia i've tried with:
glTexImage2D(GL_TEXTURE_RECTANGLE_NV,0,GL_FLOAT_RG B32_NV,t->whidth,t->height,0,GL_FLOAT_RGB32_NV,GL_FLOAT,t->pixmapF);
And in my shader i get this texture with uniform sampler2DRect but i obtain nothing.
Filtering is NEAREST.
Do you have any idea?
Thank you

kon
09-30-2005, 06:04 AM
Have you changed the texture coordinates to [0, t->whidth] and [0,t->height]?

capedica
09-30-2005, 06:18 AM
i generate texture coordinate inside my shader...

kon
09-30-2005, 06:42 AM
Well, then you have to show more code (shaders) or you can try to write a constant color in the fragment shader to check that texture setup is correct.

capedica
09-30-2005, 08:15 AM
you were right!! in my shader i was generating texture coordinates between 0 and 1, after converting that in interval [0,texture width=texture height] all goes right, thank you.