427
ows, modeling refl ective surfaces, accounting for interrefl ection between ob-
jects (where the color of one object aff ects the colors of surrounding objects),
and modeling caustic eff ects (the intense refl ections from water or a shiny
metal surface). Other global illumination models att empt to provide a holis-
tic account of a wide range of optical phenomena. Ray tracing and radiosity
methods are examples of such technologies.
Global illumination is described completely by a mathematical formula-
tion known as the rendering equation or shading equation. It was introduced in
1986 by J. T. Kajiya as part of a seminal SIGGRAPH paper. In a sense, every
rendering technique can be thought of as a full or partial solution to the ren-
dering equation, although they diff er in their fundamental approach to solv-
ing it and in the assumptions, simplifi cations, and approximations they make.
See htt p://en.wikipedia.org/wiki/Rendering_equation, [8], [1], and virtually
any other text on advanced rendering and lighting for more details on the
rendering equation.
10.1.3.2. The Phong Lighting Model
The most common local lighting model employed by game rendering engines
is the Phong refl ection model. It models the light refl ected from a surface as a
sum of three distinct terms:
z The ambient term models the overall lighting level of the scene. It is a
gross approximation of the amount of indirect bounced light present
in the scene. Indirect bounces are what cause regions in shadow not to
appear totally black.
z The diff use term accounts for light that is refl ected uniformly in all direc-
tions from each direct light source. This is a good approximation to the
way in which real light bounces off a matt e surface, such as a block of
wood or a piece of cloth.
z The specular term models the bright highlights we sometimes see when
viewing a glossy surface. Specular highlights occur when the view-
ing angle is closely aligned with a path of direct refl ection from a light
source.
Figure 10.23 shows how the ambient, diff use, and specular terms add together
to produce the fi nal intensity and color of a surface.
To calculate Phong refl ection at a specifi c point on a surface, we require
a number of input parameters. The Phong model is normally applied to all
three color channels (R, G and B) independently, so all of the color parameters
in the following discussion are three-element vectors. The inputs to the Phong
model are:
10.1. Foundations of Depth-Buffered Triangle Rasterization