phil@BRL.MIL (Phil Dykstra) (03/23/90)
My thanks to Tim Hall for pointing out a useful, but rather startling "feature" of libgl. You can in fact get diffuse lighting of both sides of a polygon by using diametrically opposed lights. Consider the following strange case: I have a red light at the eye, and a blue light behind the scene exactly opposite of the eye. If I view the front side of a diffusely shaded polygon, it is red. If I am looking at the back side of a polygon it will appear blue! I.e. I end up seeing the blue light which has been cast on the side of the polygon pointing away from the eye! I can pretty easily understand how this came to be: Since the diffuse component depends only on the surface-normal-to-light angle, and not on the viewing direction, then if a light shines on the front face we shade it, even if that face is not visible from (i.e. not pointing toward) the eye. The same logic also explains why the ambient term makes no distinction between front and back (it depends on neither the light nor the view direction), and why the specular term is strictly one sided (it depends on both angles). So the current situation w.r.t. lighting polygon sides is a mixed bag: A polygon is one sided for specular, two sided for ambient, and a "one sided absorber/two sided radiator" for diffuse. Is this behavior by choice, or is this considered a bug? Can we write programs that depend on this or will it change in a future release? Someone told me that the VGX handles two sided polygons. Have the lighting model semantics changed? [glcompat(GLC_OLDLMODEL, FALSE):-] - Phil