i
i
i
i
i
i
i
i
6.7. Bump Mapping 197
changing heightfields. Schroeders and Gulik [1134] present quadtree relief
mapping, a hierarchical method to skip over volumes during traversal. Tevs
et al. [1264] use “maximum mipmaps” to allow skipping while minimizing
precomputation costs.
Although this is an active area of research and is highly sensitive to
particular GPU architectures, in preliminary testing, one of the most time-
and space-efficient methods for relief mapping at the time of printing is
Tatarchuk’s [1244] linear ray-marching with single-step secant correction.
That said, newer methods, such as cone-stepping and quadtree relief map-
ping, were not part of this informal survey. Unquestionably, research will
continue to improve algorithms in this area.
One problem with relief mapping methods is that the illusion breaks
down along the silhouette edges of objects, which will show the original
surface’s smooth outlines. See Figure 6.35.
The key idea is that the triangles rendered define which pixels should
be evaluated by the pixel shader program, not where the surface actually
is located. In addition, for curved surfaces, the problem of silhouettes be-
comes more involved. One approach is described and developed by Oliveira
and Policarpo [964, 1334], which uses a quadratic silhouette approximation
technique. Jeschke et al. [610] and Dachsbacher et al. [223] both give a more
general and robust method (and review previous work) for dealing with sil-
houettes and curved surfaces correctly. First explored by Hirche [552], the
general idea is to extrude each polygon in the mesh outwards and form a
prism. Rendering this prism forces evaluation of all pixels in which the
heightfield could possibly appear. This type of approach is called shell
Figure 6.36. Parallax occlusion mapping, a.k.a. relief mapping, used on a path to make
the stones look more realistic. (Image from “Crysis” courtesy of Crytek.)
i
i
i
i
i
i
i
i
198 6. Texturing
mapping, as the expanded mesh forms a separate shell over the original
model. By preserving the nonlinear nature of prisms when intersecting
them with rays, artifact-free rendering of heightfields becomes possible,
though expensive to compute.
To conclude, an impressive use of this type of technique is shown in
Figure 6.36.
6.7.5 Heightfield Texturing
One obvious method of rendering bumps is to model the bumps as true
geometry, in a very fine mesh. A space-efficient alternative is to use the
vertex texture fetch feature (introduced in Shader Model 3.0) to have a
flat meshed polygon access a heightfield texture. The height retrieved from
the texture is used by the vertex shading program to modify the vertex’s
location. This method is usually called displacement mapping,andthe
heightfield is therefore called a displacement texture in this context. Us-
ing a texture allows for faster manipulation of data for wave simulations
and other animations to apply to the mesh. These techniques can be ex-
pensive in both memory and in processing power, as each vertex in the
mesh requires three additional floating-point numbers, all of which must
be accessed (the less memory touched, the better). For large expanses
(e.g., terrain or ocean rendering [703]), where level of detail techniques can
be brought to bear to keep complexity down, such an approach can be
suitable. See Section 12.5.2. With the evolution of GPUs towards unified
shaders
14
and performing tessellation on the fly, the scale appears to be
tipping towards this being the preferred method in general. It is simple
to program and on newer GPUs has few drawbacks. We consider it likely
that this will be the preferred method once the minimum GPU required
for an application supports fast vertex texture access. Szirmay-Kalos and
Umenhoffer [1235] have an excellent, thorough survey of relief mapping and
displacement methods.
While relief and displacement mapping offer additional realism at a
generally reasonable cost, these techniques do have some drawbacks. The
fact that the base surface is unperturbed makes collision detection, and
therefore object interaction, more challenging. For example, if a displace-
ment map is used to model a rock protruding out of the ground, it will
be additional work to have a character’s foot properly stop at the correct
height at this location. Instead of a simple test against a mesh, the mesh
height will also need to be accessed.
Other surfaces than simple quadrilaterals can use displacement map-
ping. Its use with subdivision surfaces is discussed in Section 13.5.6. In
14
The original vertex texture fetch was slow compared to the pixel shader’s. With
unified shaders there is no difference.
i
i
i
i
i
i
i
i
6.7. Bump Mapping 199
Section 13.6, we present hardware tessellation where displacement mapping
also can be used.
Further Reading and Resources
Heckbert has written a good survey of the theory of texture mapping [517]
and a more in-depth report on the topic [518]; both are available on the web.
Wolberg’s book [1367] is another older but worthwhile work on textures,
particularly in the areas of sampling and filtering. Watt’s books [1330,
1331, 1332, 1333] are general texts on computer graphics that have more
information about texturing.
Articles by Geiss [386] and Andersson [23] are excellent resources for
ideas on using traditional and procedural textures to produce complex sur-
face and terrain effects.
The book Advanced Graphics Programming Using OpenGL [849] has
extensive coverage of various texturing algorithms. While RenderMan is
meant for offline rendering, the RenderMan Companion [1283] has some
relevant material on texture mapping and on procedural textures. For
extensive coverage of three-dimensional procedural textures, see Texturing
and Modeling: A Procedural Approach [295]. The book Advanced Game De-
velopment with Programmable Graphics Hardware [1334] has many details
about implementing relief mapping techniques, as do Tatarchuk’s presen-
tations [1244, 1248].
Visit this book’s website, http://www.realtimerendering.com, for many
other resources.
i
i
i
i
i
i
i
i
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset