Advertisement

textures and colors

Started by September 15, 2000 09:01 AM
3 comments, last by erikferner 24 years, 2 months ago
Hi ! I''m trying to use textured objects and simple non-textured colored objects in an OpenGL-Programm, but the textures seem to interfere with the colors. If for example the last loaded texture is mainly red, all colored objects have a red shimmer. Even if I take out all textured objects. It seems that the routine LoadGLTextures (from Nehe''s Tutorials) interferes in some way. If I don''t load any textures at all, the colors look fine. I haven''t found any GL-examples where textures and colors are mixed. Doesn''t it work ? Thanks Erik
you should look up glAlphaFunc and glTexParameter. they handle the blending of textures and polygons.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
Advertisement
I could see some logic to the textures being red if the last solid colour used to draw with was red (even though I don''t think it matters) but the colours of the textures do not affect the colour you draw with in any way. Unless you are blending them. Then it makes sense that they would be tinted red where they overlap.

I suggest checking to see if you are blending that specific object, or if somewhere in your LoadGLTextures function you are changing the glColor.
S.
i ran into this problem before, what i did to fix it was disable GL_TEXTURE_2D while rendering the non-textured colored objects and re-enable GL_TEXTURE_2D right after. hope it helps;
Ouch, talk about unnecessary state changes, I did run in to that once. It always got tinited the color of my last loaded texture. I think what I did was to do a last texture load with NULL as a parameter, so it loaded nothing.

This topic is closed to new replies.

Advertisement