Advertisement

Textures messing up colors

Started by December 18, 2002 08:33 PM
3 comments, last by Cat_B 22 years, 2 months ago
Hi, This has been bugging me since I started to learn openGL and I can''t seem to find the answer to it. Example: A large quad in the background textured with a bitmap. A line (or quad or whatever) drawn in the foreground. The color of the foreground object changes if I texture the background quad. It also changes even if I just load the texture but don''t actually apply it. Also, this happens even if the 2 objects don''t overlap. I have depth buffering turned on. Once, I was able to get it working by sticking in color4f(1,1,1,0) between drawing the objects (I think- I tried so many things can''t quite remember) I have blending disabled. I have tried glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL ); but it doesn''t seem to make a difference. Thanx
Disable texturing while drawing your colored objects.
Advertisement
Do you turn off texturing (call glDisable with GL_TEXTURE_2D) before you draw the foreground object(s)? Otherwise, they're being textured with a single point (the last texture coordinate used) of the last bound texture (bound while loading it or drawing something else). Edit: I'm not fast enough .



[edited by - Null and Void on December 18, 2002 9:37:56 PM]
Thanx!!!!, it works. And glad you were not fast enough Null&Void, your explaination explains why
Thanx
Ya I always wondered why that happened too , I just know how to fix it . Thanks for sharing the knowledge Null

This topic is closed to new replies.

Advertisement