Graphics Reference
In-Depth Information
Figure 1.9: (a) The image at left depicts a normal map. Each image point has x- and y-
coordinates that correspond to the latitude and longitude of a point on the sphere. The
RGB color triple stored at each point determines how much to tilt the normal vector at the
corresponding point of the sphere. The pale purple color indicates no tilt, while the four
stripes tilt the normal vector up and down or left and right. (b) The resultant shape, which
looks bumpy; you can tell it's actually smooth by looking at the silhouette. Note that it has
also been “color textured” with a reflected sky.
to a surface or gluing a decal onto an object. You can think of the texture image,
which can be a piece of artwork scanned into the system, a photo taken with a dig-
ital camera, or an image created in a paint program, for instance, as a rubber sheet
with a picture on it. The texture coordinates describe how this sheet is stretched
and deformed to cover some part of the object.
The idea of using a texture to modify the color characteristics of each point of
an image is only one of many applications of texture mapping. The central ideas
of texture mapping have been generalized and applied to many surface properties.
The appearance of a surface, for instance, depends in part on the surface's normal
vector (or normal ), which is the vector that's perpendicular to the surface at each
point. This normal vector is used to compute how light reflects from the surface.
Since the surface is typically represented by a mesh of polygons, these surface
normal vectors are usually computed at the polygon vertices and then interpolated
over the interior of the polygon to give a smooth (rather than faceted) appearance
to the shape.
If instead of using the true normal to a surface (or its approximation by inter-
polation as above) we use a substantially different one at different points of each
polygon, the surface will have a different appearance at different points, appearing
to tilt more toward or away from us, for instance. If we apply this idea across a
whole surface we can generate what seems to be a lumpy surface (see Figure 1.9),
while the underlying shape is actually nearly smooth.
The surface appears to have lots of geometric variation even though it's actu-
ally spherical. Unfortunately, near the silhouette of the surface the unvarying
nature is evident; this is a common limitation of such mapping tricks. On the other
hand, being able to draw just a few normal-mapped polygons instead of thousands
of individual ones can be enough of an advantage to make this choice appropriate.
This kind of choice is commonplace in graphics—one must decide between phys-
ical correctness (which might require huge models) and approximately correct
imagery made with smaller models. If model size and processing time constitute a
significant portion of your engineering budget, these are the sorts of tradeoffs you
have to make.
1.6.2 The More Detailed Graphics Pipeline
As we said above, a pipeline architecture lets us process many things simultane-
ously: Each stage of the pipeline performs some task on a piece of data and hands
the result to the next stage; the original pipeline stage can then begin performing
 
 
Search WWH ::




Custom Search