Game Development Reference
In-Depth Information
Chapter 13
Basic Terrain
Rendering
A terrain mesh is really nothing more than a triangle grid, as Figure
13.1.a shows, but with the heights of each vertex in the grid specified in
such a way that the grid models a smooth transition from mountain to
valley, simulating a natural terrain (Figure 13.1.b). And of course, we
apply a nice texture showing sandy beaches, grassy hills, and snowy
mountains (Figure 13.1.c).
Figure 13.1: (a) A triangle grid. (b) A triangle grid with smooth height transi-
tions. (c) A lit and textured terrain that is a screen shot from the sample we cre-
ate in this chapter.
This chapter walks you through implementing the Terrain class. This
class uses a brute force approach. By that we mean it simply stores the
entire terrain vertex/index data and then renders it. For games requir-
ing a small terrain, this approach is workable with modern graphics
cards that support hardware vertex processing. However, for games
requiring larger terrains, you have to do some kind of level of detail or
culling because the enormous amount of geometry data needed to
model such huge terrains is overwhelming for a brute force approach.
212
Search WWH ::




Custom Search