PDA

View Full Version : the colors of the texture change when i render



luisillo
06-08-2006, 06:28 AM
I have disable all the things that could change the colour of the texture, but when i make a render the final colour is similar but not the same. And i need the same colour exactly.

I use:

glDisable (GL_BLEND);
glDisable (GL_DITHER);
glDisable (GL_FOG);
glDisable (GL_LIGHTING);
glDisable (GL_TEXTURE_1D);
glShadeModel (GL_FLAT);

glDisable(GL_COLOR_MATERIAL);
glColor4f(1.,1.,1.,1.);
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

Dont use Mip-map and the textures are in RGBA format.

Thanks

pantxua
06-08-2006, 07:10 AM
Do you use GL_NEAREST or GL_LINEAR with glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,filter) ?
In your case, the correct choice should be GL_NEAREST.

luisillo
06-08-2006, 07:20 AM
Yes, i use GL_NEAREST.
Question: I have read that OpenlGL clamp the values of the texture into [0,1]. Can i lose some precission in this transformation (when convert the unsigned byte to a real into [0,1]?

Relic
06-08-2006, 11:00 AM
What is your internalFormat parameter to glTexTexture2D? Use GL_RGBA8.
What is the color resolution of your desktop?
What is the color resolution of your OpenGL pixelformat?

This will only work if the texture format is natively supported and equals the color resolution of the pixelformat and screen.

luisillo
06-09-2006, 01:43 AM
I try and works :)
The only problem, as you say, i need the same color for the screen and i cant control this.

Well, you have enlightened me, so a lot of thanks :)