Graphics Reference
In-Depth Information
Figure 9.7.
Gouraud shading anomaly.
Figure 9.8.
Phong shading anomaly.
Some anomalies can occur with Gouraud shading. Figure 9.7 shows a faceted
surface which might have been an approximation to a wavy surface, but whose
Gouraud shading would make it look flat because of the averaging of the normals.
The simplest way to get around that is to subdivide the given facets more. In the case
of Figure 9.7, we could divide each rectangular face into four subfaces.
There are other problems. If one uses Phong's reflectance model, then small vari-
ations in the normal can produce large variations in the specular reflection. This
causes Gouraud's method to produce peculiar highlights.
Phong Shading. To remedy some of the problems with Gouraud shading, Phong
([BuiT75]) interpolated the surface normals (rather than the intensities) at vertices
across faces and then computed the illumination at each point directly from the
normals themselves. This clearly takes more work, however. In particular, generating
unit-length vectors means taking square roots, which is costly in time. To lessen this
cost, one can use a lookup table and linear interpolation ([Duff79]). Alternatively, one
can use a Taylor expansion to get a good approximation ([BisW86]). The latter
approach produces pictures indistinguishable from real Phong shading at a cost that
is not much greater than that of Gouraud shading.
Phong shading produces better results than Gouraud shading, but it also has prob-
lems. Consider the concave polygon in Figure 9.8. The difference between the inter-
polated normal at the point P and the normal at the vertex V could cause a big change
in the illumination value as one moves from P to V . This again shows the importance
of sampling properly.
Gouraud and Phong shading basically assumed a scan line visible surface algo-
rithm approach. In that context, one can speed up the process by computing the
shading equations incrementally.
Search WWH ::




Custom Search