Graphics Reference
In-Depth Information
The situation is even worse, however: Interpolation between pairs of points,
if it were possible, would let us extend our function's domain from vertices to
edges of the mesh. Suppose that somehow we were given such an extension;
could we then extend continuously over triangles? Alas, no. The study of when
such extensions exist is a part of homotopy theory, and particularly of obstruction
theory [MS74]. We mention this not because we expect you to learn obstruction
theory, but because we hope that the existence of theorems like the ones above will
dissuade you from trying to find ad hoc methods for extending functions whose
codomains don't have simple enough topology.
9.4.2 Which Interpolation Method Should I Really Use?
The problem of interpolating over the interior of a triangle applies in many situa-
tions. If we are interpolating a color value, then linear interpolation in some space
where equal color differences correspond to equal representation distances (see
Chapter 28) makes sense. If we are interpolating a unit normal vector value, then
linear interpolation is surely wrong, because the interpolated normal will gener-
ally not end up a unit vector, and if you use it in a computation that relies on unit
normals, you'll get the wrong answer. And if the value is something discrete, like
an object identifier, then interpolation makes no sense at all.
All of this seems to lead to the answer, “It depends!” That's true, but there's
something deeper here:
T HE MEANING PRINCIPLE : For every number that appears in a graphics
program, you need to know the semantics, the meaning, of that number.
Sometimes this meaning is given by units (“That number represents speed in
meters per second”); sometimes it helps you place a bound on possible values for
a variable (“This is a solid angle, 1
12.5”
or “This is a unit normal vector, so its length should be 1.0”); and sometimes
the meaning is discrete (“This represents the number of paths that have ended
at this pixel”). It's important to distinguish the meaning of the number from its
representation. For instance, we often are interested in the coverage of a pixel
(how much of a small square is covered by some shape) as a number
so it should be between 0 and 4
π ≈
α
between
α
zero and one, but
is sometimes represented as an 8-bit unsigned integer, that is,
an integer between 0 and 255. Despite the discrete nature of the representation, it
makes perfectly good sense to average two coverage values (although representing
the average in the 8-bit form may introduce a roundoff error, of course).
9.5 Functions Multiply Defined at Vertices
Until now, we've discussed the very common case of functions that have a single
value at each vertex and need to be interpolated across faces. But another situa-
tion arises frequently in graphics: a function where there's a value at each vertex
for each triangle that meets that vertex . Consider, for instance, the colored octa-
hedron in Figure 9.11. Each triangle has a color gradient across it, but no two
1. Solid angles are discussed in Chapter 26.
 
 
 
 
Search WWH ::




Custom Search