Game Development Reference
In-Depth Information
Phong Reflection Model
Once the lights have been placed in a level, the game needs to calculate how the
lights affect the objects in the scene. These calculations can be done with a bid-
irectional reflectance distribution function (BRDF), which is just a fancy way
of saying how the light bounces off surfaces. There are many different types of
BRDFs, but we will only cover one of the most basic: the Phong reflection mod-
el . It should be noted that the Phong reflection model is not the same thing as
Phong shading (which we will cover in a moment). The two are sometimes con-
fused, but they are different concepts.
The Phong model is considered a local lighting model , because it doesn't take
into account secondary reflections of light. In other words, each object is lit as if
it were the only object in the entire scene. In the physical world, if a red light is
shone on a white wall, the red light will bounce and fill out the rest of the room
with its red color. But this will not happen in a local lighting model.
InthePhongmodel,lightisbrokenupintothreedistinctcomponents: ambient, dif-
fuse, and specular, which are illustrated in Figure 4.14 . All three components take
into account both the color of the object and the color of the light affecting the ob-
ject. The ambient component is tied to the overall illumination of the scene and
can be directly tied to the ambient light. Because it's evenly applied to the entire
scene, the ambient component is independent ofthe location oflights andthe cam-
era.
Search WWH ::




Custom Search