Game Engine Architecture

(Ben Green) #1

422 10. The Rendering Engine


we create a sequence of lower-resolution bitmaps, each of which is one-half
the width and one-half the height of its predecessor. We call each of these
images a mipmap, or mip level. For example, a 64 × 64 texture would have the
following mip levels: 64 × 64, 32 × 32, 16 × 16, 8 × 8, 4 × 4, 2 × 2, and 1 × 1, as
shown in Figure 10.18. Once we have mipmapped our textures, the graphics
hardware selects the appropriate mip level based on a triangle’s distance away
from the camera, in an att empt to maintain a texel density that is close to one.
For example, if a texture takes up an area of 40 × 40 on-screen, the 64 × 64 mip
level might be selected; if that same texture takes up only a 10 × 10 area, the
16 × 16 mip level might be used. As we’ll see below, trilinear fi ltering allows
the hardware to sample two adjacent mip levels and blend the results. In this
case, a 10 × 10 area might be mapped by blending the 16 × 16 and 8 × 8 mip
levels together.

Figure 10.17. A texel density greater than one can lead to a moiré pattern.

Figure 10.18. Mip levels for a 64×64 texture.

World Space Texel Density
The term “texel density ” can also be used to describe the ratio of texels to world
space area on a textured surface. For example, a two meter cube mapped with
a 256 × 256 texture would have a texel density of 256^2 /2^2 = 16,384. I will call this
world space texel density to diff erentiate it from the screen space texel density
we’ve been discussing thus far.
Free download pdf