
11. Rendering 309
11.4.3 Phong Shading
In Phong shading true surface normals are computed at the facet vertices.
Approximate surface normals at points in the facet are obtained by linearly
interpolating the vertex normals. If the exact surface normals of two vertices
A and B are N
0
(x
0
,y
0
,z
0
)andN
1
(x
1
,y
1
,z
1
), then the interpolated normal of
apointL =(1− s)A + sB,for0≤ s ≤ 1, is taken to be the normalization
of N =(1− s)N
0
+ sN
1
. The approximate normal of any point in the facet
can be obtained using a scanline method similar to the one used in Gouraud
shading, but normals are interpolated in place of intensities. Since approxi-
mate normals avoid computing surface derivatives, they are more efficient to
use than true surface normals. The Phong method then applies (11.7), using
the approximate normals, to compute the intensities at points in each facet.
The gradual variation of normals across each facet means that Phong shad-
ing produces a smoother and more natural looking shading than both the flat
and Gouraud methods. Figure 11.8(d) shows a rendering of a sphere using the
Gouraud method.
EXERCISES
11.1. Write a computer program that converts a RGB coordinate (r, g, b)
to a HSV coordinate (h, s, v) and vice versa.
11.2. Consider a point light source positioned at (0, 10, 20) shining on
the surface x(s, t)=(s, t, −s
2
− t
2
), 0 ≤ s, t ≤ 1. Determine the
reflected vector R of the incident ray that hits the surface at the
point x(0.5, 0.5) = (0.5, 0.5, −0.5). Determine the angle of incidence.
11.3. Write a computer program to perform Flat, Gouraud or Phong shad-
ing of an object with polygonal faces.
11.5 Silhouettes
In contrast to the photorealism of computer graphics rendering, CAD drawings
are predominately line drawings with little or no shading. For objects with faces
that are planar, a CAD style drawing can be obtained using projections together
with edge and vertex information. In Section 4.3 it was shown that a parallel
or perspective projection maps a linear edge AB to the linear segment joining
the images of A and B. Projections of non-linear edges can be determined