PDA

View Full Version : Specular highlight



digitalshooter
09-09-2008, 11:09 PM
Hi, I have a program with a sphere and a cylinder, I copied the code to draw the sphere from my book, and I draw the cylinder by myself. The sphere has a nice specular spot on it when I move the light around, but I can not make the cylinder has any specular spot, please help. I draw both object with same color, same material settings.

Thank you.

Nighthawk
09-10-2008, 03:39 AM
Does the diffuse lighting work? If not, check the normals.

If you use normal per-vertex lighting(glLight), generate more triangles for the cylinder.

uruk
09-10-2008, 04:18 AM
I think this is what you need:

glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPA RATE_SPECULAR_COLOR);