• Advertisement

Archived

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

Lighting problems...

This topic is 5993 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! I''m having this problem with lighting in my opengl 3D engine.. With textures it works fine, but the objects that only have a color (set with glColor3f()) and no texture show shaded but not with the color I set to them but the color I set as the light''s ambient value. So most of the time they just look solid white. I set correct normals to the objects so that shouldn''t be the problem. Can you help me or at least point me to the right direction? Thanks a lot! Jarkko

Share this post


Link to post
Share on other sites
Advertisement
u need to use materials with lighting enabled check here
http://www.frii.com/~martz/oglfaq/

Share this post


Link to post
Share on other sites
Thanks for your help, I added the material code:

glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);

to the rendering function and now everything works fine!

Thanks!

Jarkko

Share this post


Link to post
Share on other sites

  • Advertisement