textures and colors
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.
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 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;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement