Archived

This topic is now archived and is closed to further replies.

stu_pb

How to disable the vertex color...

Recommended Posts

I''m new to OpenGL so this question is probably pretty dumb. I have a single quad with a texture on it and this seems to work ok. When I add some bitmap fonts for the fps in the upper left corner of the screen I call glColor3f(1.0f,0.0f,0.0f) to draw the text in red. However, now the texture also has a red shade, I think because the vertices of the quad are also using the glColor value. How can I disable the color at these vertices? Hopefully that made some sense! I should probably be working now...

Share this post


Link to post
Share on other sites
Your texture environment is probably set to GL_MODULATE. This texture mode will turn your texture whatever color you call (it multiplies the texture color with the primary color). There are two ways to fix this. 1) Call glColor3f(1,1,1) right before you draw the quad or 2)Change your texture environment mode to GL_REPLACE by calling glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

-------------------
Realm Games Company

Share this post


Link to post
Share on other sites

I just wanted to say: THANK YOU !!!! I''ve been having this problem the other way round. I was doing some multitexturing, but my (normally green) bitmap font turned white. After 2 weeks I still didn''t know what caused it. It''s fixed now though.

Thanks again,

Edo

Share this post


Link to post
Share on other sites