Jump to content
  • Advertisement
Sign in to follow this  
bovinedragon

Lighting + Color

This topic is 3997 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

Advertisement
Write "glEnable(GL_COLOR_MATERIAL);" and look up the use of "glColorMaterial" to have the material colour track the current drawing colour.

Share this post


Link to post
Share on other sites
Or the simpliest way is to use parameter glMaterialf (or glMaterialfv)!
There are few types of material:
glMaterialfv(first parameter, second parameter, float variable[]);
first parameter can be GL_FRONT (just front faces directing to light), GL_BACK (just back faces) or GL_FRONT_AND_BACK (front and back faces)
second parameter can be GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_AMBIENT and GL_SHININESS (but if you write shininess, next value must be just one float! and it's written by glMaterialf (NOT glMaterialfv), another parameters-> 4 floats in variable).

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!