Graphics Reference
In-Depth Information
that will be rendered to make the final image, the terrain is often created by software algo-
rithms, rather than hand-sculpted by an artist (however, a combination of both is common).
A typical input is a height map —a monochrome texture where each pixel represents the
elevation of the terrain at that particular point on the grid.
Using terrain rendering can easily require large data sets, both in terms of textures
and geometry. It is not uncommon to have huge draw distances, stretching from the imme-
diate foreground where the camera is located, out to the distant horizon. Many algorithms
have been invented and refined over the years to efficiently solve this problem and, for the
most part, the problem is well understood. As hardware performance and features have
improved (such as the move from CPU to GPU processing) these algorithms have been
adapted to take advantage.
Direct3D 11 's tessellation capabilities may not revolutionize this problem space, but
they do offer some interesting alternatives. Terrain rendering stands as a good example of
the new functionality. Most current algorithms require at least some intervention and pro-
cessing by the CPU before the GPU does the actual rendering; but with Direct3D 11 it is
now possible to offload all processing to the GPU. Both existing "classic" algorithms can
be adapted to suit this new hardware and the reverse is also true—new hardware opens up
avenues for wholly new algorithms and rendering approaches.
9.1.1 GPU-Accelerated Interlocking Tiles Algorithm
Figure 9.1 shows a nai've rendering of a traditional heightmap-based terrain. The geometry
is uniformly distributed across the entire terrain, with no regard to the characteristics of the
terrain or viewer. Figure 9.2 shows the same inputs rendered using the interlocking terrain
tiles algorithm algorithm introduced in this section—detail is now applied only where it is
Figure 9.1. Naive rendering.
Figure 9.2. Interlocking Terrain Tiles Algorithm.
Search WWH ::




Custom Search