Lighting is one of the most important factors influencing the way we perceive everything that surrounds us. Most of the information our brains gather about the world comes from our eyes. Human sight is very sensitive to even the slightest change in lighting conditions. That's why lighting is also very important for creators of 3D applications, games, and movies.
In the times when 3D graphics libraries supported only a fixed-function pipeline, lighting calculations were performed according to a predefined set of rules--developers could only select colors for a light source and a lit object. This led most games and applications that used a given library to have a similar look and feel. The next step in the evolution of graphics hardware was the introduction of fragment shaders: their main purpose was to calculate the final color of a fragment (pixel). Fragment shaders literally shaded the geometry...