PDA

View Full Version : (Double??) Normals for primitives



ngill
07-22-2000, 09:12 PM
lets say I have a triangle at 0,0,-1
and it's normal is 0,0,1 now if I have a light source which is on the other side i.e. (z<-1) would the lighting properties be calculated correctly for the other face of the triangle? or do I have to do some special stuff to enable it or something?

And yes, I am aware, that with the current position I will not be able to see the back face of the triangle. I meant, if I was teleported to the other side, and was looking at the back face.

Relic
07-23-2000, 12:54 AM
Yes, this is easily possible. You'll have to enable two sided lighting (default off, look for GL_LIGHT_MODEL_TWO_SIDE) and disable face culling (default off).
If the OpenGL driver finds the face direction to be back facing, the normal will be inversed before lighting calculations start.