Jump to content
  • Advertisement
Sign in to follow this  
Geometrian

OpenGL glColor*f()

This topic is 3897 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! In my OpenGL programs I have noticed a phenomenon which completely baffles me and is really annoying. glColor4f() and glColor3f() don't work when there's lighting. If I draw what should be a red cube, it is red until the lights come on. Then it is shades of grey. To fix this, I have made textures, one pixel big with my desired color on them. Texturing the objects than gives the effect I want. I am certain this is not the right way to fix this problem. How do I fix it then? Thanks, Geometrian [Edited by - Geometrian on February 16, 2008 7:10:50 PM]

Share this post


Link to post
Share on other sites
Advertisement
Thanks, everyone!
This fixed it:
glEnable(GL_COLOR_MATERIAL)
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE)
That, and turning on lighting.
Thanks again!
G

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!