Graphics Reference
In-Depth Information
The ADS Lighting Model
This lighting model is the basis for fixed-function OpenGL lighting, and we
want to see how to handle this in shaders you write yourself. You were prob-
ably introduced to this in your beginning computer graphics course, but let's
review it to be sure we're all using the same terminology and notation. The
three kinds of light used in this model are
Ambient light, or light that is always present at all points in a scene.
Difuse light, or light that comes directly from a light source.
Specular light, or light that is reflected in a “shiny” way from a light source
by an object.
Each of these kinds of light contributes to the overall lighting at any
point in a separate way. The general context for these contributions is shown
in Figure 6.1, which illustrates a point on a surface with normalized (unit) vec-
tors from the point to the eye, E ; from the point to a light source, L ; the normal
to the surface at the point, N ; and the reflected light direction R .
Ambient light contributes to the lighting as a product of the ambient light
itself
L
and the ambient light color of the material being lighted
M
:
A
A
=* .
Diffuse light contributes to the lighting as a product of the diffuse light
AL M
A
A
itself
L the diffuse light color of the material being lighted ,
,
M
and the
D
cosine of the angle Θ between the light and the normal, ( L N ):
D = L D * M D * ( L N ).
Figure 6.1. The setup for ADS lighting.
Search WWH ::




Custom Search