Game Development Reference
Ambient lighting is used to simulate the base background lighting of a scene. It is
essentially the minimum color value of every pixel in the scene in the absence of
any other light sources; so if we had an ambient lighting value of (0.3,0.3,0.3), and
there were no other light sources present, everything we render would be colored
dark grey. Computationally, this effect is cheap.
Diffuse lighting, as mentioned earlier, depends on the direction of the light and sim-
ulates the effect of light radiating from a source and rebounding off the surfaces. The
shallower the angle between the direction of the light and the surface, the weaker the
effect that the light will have on that surface. This effect requires additional mathem-
atics compared to ambient lighting (essentially one dot-product per vertex per light)
to determine the output.
Finally, specular lighting represents the shininess of an object by highlighting certain
areas with a brighter color depending on the angle of the camera with the light
source. Because the camera also gets involved, the effect itself changes as the cam-
era moves, and requires a greater amount of mathematics to produce.
However, despite of the difference in mathematical requirements, these three effects
are almost trivialized by modern GPUs, and there are far more advanced and real-
istic visual effects such as global illumination, refraction, depth of field, HDR lighting,
and so on, making these simple lighting effects a drop in the ocean by comparison.
The following diagram shows the same object rendered with ambient, ambient plus
diffuse, and ambient plus diffuse plus specular lighting, respectively.