Graphics Reference
In-Depth Information
deal with repeated patterns like this is to predefine only a primitive part of the pattern
and then get the repetition using the mod function as in
(
) = (
)
F u v
,
2
uk
p
mod ,
1
vk
mod
1
.
For example, if k is 10, then we get a 10 ¥ 10 grid on the patch.
These examples show the essential idea behind texture mappings but assume a
perfect mathematical model with all computations carried out to infinite precision.
Implementing such an approach involves a lot of work and care must be taken to
avoid aliasing. If the rendering algorithm is a scan line algorithm, then for each screen
coordinate (x,y) one needs to find the (u,v) so that p(u,v) projects to (x,y), which is
time consuming. Catmull ([Catm74]) subdivided the surface until each patch pro-
jected into a single pixel. One could then map the center of each of the corresponding
rectangles in (u,v) space to texture space. Unfortunately, this straightforward
approach leads to aliasing. In Figure 9.14 we might miss the grid lines. Aliasing is a
serious problem for texture mappings. One solution is to sample at higher resolutions
and the other is to use filters before sampling. Catmull used the latter and a convo-
lution filter. He also subdivided texture space at the same time until each of its patches
mapped onto a single pixel and used the average of the texture values in that final
texture patch. A better solution is the one found in [BliN76].
Another problem with the above is distortion of the texture if the parameteriza-
tion is not chosen correctly. For example, if we parameterize the cylinder by
(
)
(
) =--
2
puv
,
u
,
1
u v
,
,
then the grid pattern is no longer uniformly spaced on the cylinder. The problem is
that the parameterization is not a similarity map. Few are. One simple approach that
seems to be quite successful for spline surfaces is to use a chord length approxima-
tion to the original parameterization. See [WooA98]. Bier and Sloan ([BieS86]) sug-
gested another approach to alleviate the distortion problem. The idea is to define
the texture for an intermediate surface I and then use a map m from that surface to
the target surface O . Four methods have been used to define the map m : I Æ O . Let
q =m( p ).
Method 1. This method computes m -1 . If R is the ray starting at q that is the reflec-
tion of the ray from the eye to q , then p is the intersection of R with the intermedi-
ate surface. See Figure 9.15(a).
Method 2. This method also computes m -1 . If R is the ray starting at q in the direc-
tion of the normal to the target surface at q , then p is the intersection of R with the
intermediate surface. See Figure 9.15(b).
Method 3. This is yet another method which computes m -1 . If R is the ray from the
centroid of the target surface to q , then p is the intersection of R with the interme-
diate surface. See Figure 9.15(c).
Method 4. If R is the ray from p in the direction of the normal to the intermediate
surface at p , then q is the intersection of R with the target surface. See Figure 9.15(d).
Search WWH ::




Custom Search