If [3] != 0
, x,y,z is the punctual position, and attenuation is calculated.
Otherwise, light is at infinity (like the sun, the source is a plane) and x,y,z
is the incoming direction, and attenuation is ignored.
TODO formulas.
https://sjbaker.org/steve/omniv/opengl_lighting.html
Summary:
- without
glEnable(GL_COLOR_MATERIAL)
, color is determined byglMaterial*
- otherwise, color is determined by
glColor*
(like when lightning is off)sjbakr.org
recommends this. We use it most of the time.