the colors of the texture change when i render

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

Do you use GL_NEAREST or GL_LINEAR with glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,filter) ?
In your case, the correct choice should be GL_NEAREST.

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]?

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.

I try and works :slight_smile:
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 :slight_smile: