Graphics Programs Reference
In-Depth Information
know about lighting and shading. Lighting ( physics terminology) is the interaction
between a surface (made up of a specific material) and a light source. Shading is a
technique in computer-graphics that uses lighting to determine the final color of a
fragment.
Illumination Models
A model for the interaction of light with a surface is called an illumination model
(also known as a lighting model). In computer-graphics, the commonly used illumin-
ation models are Lambert and Phong . In the Lambert model, the reflection of light
from an object's surface is independent of the viewing direction (that is, the vector
pointing from the viewer to the object's surface). In contrast, in the Phong model,
the reflection of light depends on the viewing direction. This section focuses on the
Lambert model.
Note The type of reflection in the Lambert model is known as dif-
fuse reflection . Diffuse reflections from the surfaces are scattered
with equal intensity in all directions, independent of the viewing dir-
ection. Surfaces that behave this way are called Lambertian reflect-
ors .
To implement this model, you must understand Lambert's Cosine Law . This states
that the reflection of light from a Lambertian reflector varies as the cosine of the
angle between the normal to the surface and the direction of the reflected ray.
For this reason, a surface perpendicular to the direction of the incident light appears
brighter than a surface that is oblique to the direction of this light. Next, we talk about
the lighting equations involved in this model.
Diffuse Reflection: Equations for Illumination
Diffuse reflection involves two vectors—the vector S from surface to light source,
and the normal N to surface, as shown in Figure 5-8 . For obvious reasons, when light
arrives along N , the illumination of the surface is highest. It is zero, when light is
perpendicular to N .
 
Search WWH ::




Custom Search