Graphics Reference
In-Depth Information
10.4 Shading
The shading models proposed by Gouraud [Gouraud, 1971] and Phong have survived over 30
years of usage. To begin with, Gouraud proposed that if one could compute the light intensity
at two opposite edges of a polygon, the light intensity between the two points could be linearly
interpolated. Such a scheme is shown in Fig. 10.4.
L l
L r
n
n
Figure 10.4.
On the left-hand side of the polygon the light intensity is calculated as
I l =
I a k a +
I i k d n
·
L l
whereas the light intensity on the right-hand side is calculated as
I r =
I a k a +
I i k d n
·
L r
Intermediate points on the line connecting the two extremes are linearly interpolated between
I l and I r .
Gouraud also devised a clever way of creating the appearance of a smooth object by making
the shared edges of polygonal shapes invisible. The strategy involves taking the average normal
at each vertex of an object, which ensures that the light intensities along the edges of a polygon
are shared by neighbouring polygons. Figure 10.5 shows four connecting polygons with their
independent surface normals. An average normal n l is computed at the shared vertex where the
polygons meet and used in the above lighting calculations:
n l =
n 1 +
n 2 +
n 3 +
n 4
At the other end of the edge a similar averaging takes place between the four touching polygons
to produce an average normal n r . Light intensities are calculated at either end and then inter-
polated along the edge. Both normals require normalizing before they are used in the lighting
calculations.
 
Search WWH ::




Custom Search