To do physically-correct shading,
one must perform a global
calculation to see how light bounces (possibly multiple times) off of
surfaces. This would include:
Real lighting requires that objects
be lit not only by light sources but by objects themselves – both the same
object and other objects. These
operations tend to be recursive and computationally expensive.
- All the light sources
- All the objects and their materials
In real-time computer games, speed
is of the utmost importance.
Instead, OpenGL processes each
primitive independently, or locally. As a consequence, objects
are lit only by light sources – not by light from other objects.
This is a highly simplified model
compared the complexity of the real world.
However, it is suitable for hardware implementation and produces
compelling shading for games.