Lighting problems...

Started by
1 comment, last by jalaine 22 years, 7 months ago
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
Advertisement
u need to use materials with lighting enabled check here
http://www.frii.com/~martz/oglfaq/
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

This topic is closed to new replies.

Advertisement