Game Development Reference
In-Depth Information
Figure 10.28
A Gouraud shaded teapot
Compare the specular highlights
in the Gouraud shaded teapot with
the highlights in a Phong (per-
pixel) shaded teapot, shown in
Figure 10.29. Notice how much
smoother the highlights are. Except
for the silhouette and areas of ex-
treme geometric discontinuities, such
as the handle and spout, the illu-
sion of smoothness is very convinc-
ing. With Gouraud shading, the in-
dividual facets are detectable due to the specular highlights.
The basic problem with interpolated shading is that no value in the
middle of the triangle can be larger than the largest value at a vertex;
highlights can occur only at a vertex. Su cient tessellation can overcome
this problem. Despite its limitations, Gouraud shading is still in use on
some limited hardware, such as hand-held platforms and the Nintendo Wii.
One question that you should be asking is how the lighting can be com-
puted at the vertex level if any maps are used to control inputs to the
lighting equation. We can't use the lighting equation as given in Equa-
tion (10.14) directly. Most notably, the diffuse color m diff is not usually a
vertex-level material property; this value is typically defined by a texture
map. In order to make Equation (10.14) more suitable for use in an inter-
polated lighting scheme, it must be manipulated to isolate m diff . We first
split the sum and move the constant material colors outside:
Figure 10.29
A Phong shaded teapot
n
( s j m spec ) max ( n h j ,0) m gls + ( s j m diff ) max ( n l j ,0)
c lit =
j=1
+ g amb
m amb + m emis
n
n
m spec ) max ( n h j ,0) m gls +
=
( s j
( s j
m diff ) max ( n l j ,0)
j=1
j=1
+ g amb
m amb + m emis
 
Search WWH ::




Custom Search