Game Development Reference
In-Depth Information
This produces a significant reduction in bandwidth to the GPU (due
to the decrease in sizeof(SkinnedVertex) ), as well as a reduction in per-
vertex computation, especially when basis vectors are present. It just re-
quires a bit more manipulation of the matrices before handing them to the
GPU.
We have presented the basic idea behind simple skinning. Certainly, in
situations where computing resources (and human resources!) are available
and worth expending to produce the highest fidelity characters possible,
such as in fighting games or sports games, more advanced techniques can
be employed. For example, we might want to make the bicep bulge as
the arm bends up, or squish out the flesh of a dinosaur foot as weight is
transferred and the foot is pressed harder into the ground.
10.9
Bump Mapping
The first use of texture mapping in computer graphics was to define the
color of an object. But texture mapping can be used when we want to
specify any surface property with more granularity than at the vertex level.
The particular surface property that perhaps is closest to controlling its
“texture,” in the sense most laypersons would understand it, is actually
the surface normal.
Bump mapping is a general term that can refer to at least two different
methods of controlling the surface normal per texel. A height map is a
grayscale map, in which the intensity indicates the local “elevation” of the
surface. Lighter colors indicate portions of the surface that are “bumped
out,” and darker colors are areas where the surface is “bumped in.” Height
maps are attractive because they are very easy to author, but they are not
ideal for real-time purposes because the normal is not directly available;
instead, it must be calculated from the intensity gradient. We focus here
on the technique of normal mapping, which is very common nowadays and
what most people usually mean when they say “bump map.”
In a normal map, the coordinates of the surface normal are directly
encoded in the map. The most basic way is to encode x, y, and z in
the red, green, and blue channels, respectively, although certain hardware
supports more optimized formats. The values are usually scaled, biased,
and quantized such that a coordinate value of −1 is encoded as a 0, and +1
is encoded using the maximum color value (usually 255). Now, in principle,
using a normal map is simple. In our lighting calculation, rather than using
the result of interpolating the vertex normals, we fetch a normal out of the
normal map and use it instead. Voila! Ah, if only it were that easy. . .
Complications arise for two primary reasons. First, normal maps are
not intuitive to edit. While a height map (or true displacement map) can
 
Search WWH ::




Custom Search