specular lighting is not well displayed !

Started by
3 comments, last by Dmnbp7ip 17 years, 1 month ago
Hi everyone, Here is my opengl problem : I have a 3d model, which normals are well calculated (I know that because if they were not, they would be black with the light on), but that seems to get the specular lighting only from one direction. Look at the following pictures, withthe same model, but lit from front on the first one, and lit from the back on the second. http://www.macrocosm.0rg.fr/Images/cuve1.png http://www.macrocosm.0rg.fr/Images/cuve2.png Any ideas ??
Advertisement
Lighting from the back should not produce any specular highlight if view from front unless you employ specific shaders that do this.

Looks like the light in the "back" image is coming from below the mesh, so there might be a wrong specular exponent that does not produce highlights on the large body (especially if the tesselation is low). There are however some small highlights at the bottom of those "nipples".
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
I concur. I can just see the specular spot at the bottom of the item on the backlit one and what looks like light elements under the rim.

From what I understand specular is a concentration of light on one spot so would only appear in the direction of the light source itself I would expect.
Yes, but the problem is that what you see on the back picture, is the back of the model, but with the light behind it, so exactly the same configuration as the first one, excet that it is symmetrical to the XY plane... i really don't understand it.

I tried rotating the model and putting a fixed front light -> the specular lighting affects all the faces in front of the light, whatever the angle, so that's ok.

Then i tried to fix the model position, and moved the light around -> when the light passes in the back, the specular lighting is not displayed anymore !!!


I just can't understand that !

I got it !!

I needed to add the following line :

glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);


This topic is closed to new replies.

Advertisement