Game Engine Architecture

(Ben Green) #1

404 10. The Rendering Engine


can cause an object’s silhouett e edges to look blocky, as shown in Figure 10.3;
this is especially noticeable when the object is close to the camera.
Ideally, we’d like a solution that can arbitrarily increase tessellation as an
object gets closer to the virtual camera. In other words, we’d like to have a uni-
form triangle-to-pixel density, no matt er how close or far away the object is.
Subdivision surfaces can achieve this ideal—surfaces can be tessellated based
on distance from the camera, so that every triangle is less than one pixel in
size.
Game developers oft en att empt to approximate this ideal of uniform tri-
angle-to-pixel density by creating a chain of alternate versions of each triangle
mesh, each known as a level of detail (LOD). The fi rst LOD, oft en called LOD 0,
represents the highest level of tessellation; it is used when the object is very
close to the camera. Subsequent LODs are tessellated at lower and lower reso-
lutions (see Figure 10.4). As the object moves farther away from the camera,
the engine switches from LOD 0 to LOD 1 to LOD 2, and so on. This allows the
rendering engine to spend the majority of its time transforming and lighting
the vertices of the objects that are closest to the camera (and therefore occupy
the largest number of pixels on-screen).
Some game engines apply dynamic tessellation techniques to expansive
meshes like water or terrain. In this technique, the mesh is usually represented
by a height fi eld defi ned on some kind of regular grid patt ern. The region of
the mesh that is closest to the camera is tessellated to the full resolution of
the grid. Regions that are farther away from the camera are tessellated using
fewer and fewer grid points.
Progressive meshes are another technique for dynamic tessellation and
LODing. With this technique, a single high-resolution mesh is created for dis-
play when the object is very close to the camera. (This is essentially the LOD 0

Figure 10.4. A chain of LOD meshes, each with a fi xed level of tessellation, can be used to
approximate uniform triangle-to-pixel density. The leftmost torus is constructed from 5000
triangles, the center torus from 450 triangles, and the rightmost torus from 200 triangles.
Free download pdf