Ambient Lighting Math

Ambient lighting is independent of direction.

The intensity of the ambient illumination is simply the ambient value of the light source.


R = light.r * material.r
G = light.g * material.g
B = light.b * material.b

(light.r is the red value of the GL_AMBIENT color of the light source, etc.)