When there are fewer pixels in a polygon than there are pixels from the texture it is drawn with, OpenGL has to skip some of the pixels from the texture in order to make it fit. This can result in a distortion effect in the rendered polygon, an effect that worsens the more the texture is scaled down. This distortion can be distracting in an animated 3D scene and reduces the overall quality of the visuals.
Mip mapping is a technique to minimize this effect. It works by precalculating progressively smaller versions of the texture, each with half the dimensions of the previous texture (see Figure 11-3). For instance, a texture with 256x256 pixels will also have a 128x128-pixel version followed by a 64x 64-pixel version, and further smaller versions of the texture where each is half the size of the texture preceding it, down to the final texture (which is a single pixel that is an average of all the pixels in the original). When OpenGL renders a polygon with a mip mapped texture, it will use the mip level that is closest to the size of the polygon on screen, which reduces the number of skipped pixels and improves visual quality.
Was this article helpful?