Mipmapping ---------- Mipmapping is a method of reducing the amount of computation needed to accurately texture-map an image onto a polgyon. The cheesiest texture-mapping you can do is called point-sampling (or single point-sampling). Here, for each pixel on the polygon, you look up a single "texel" (pixel) in the texture image. This is very inaccurate and gives lots of aliasing (poor image quality and shimmering, in this case) whenever the pixels are larger than the texels. This effect happens when some part of the polygon is far away enough that many texels fall into the space occupied by one pixel. Note that when the polygon is very close and the texels are larger than the pixels we get a different kind of aliasing. In this case, the images start to look blocky. This kind of aliasing happens because the texture image can only be so big, limiting the resolution available to accurately represent the original image. Mipmapping doesn't really help prevent that last kind of aliasing; nothing can help that except either using larger (higher resolution) texture images or using a trick called "detail textures". Mipmapping is designed to help the first kind of aliasing, where multiple texels fit in a pixel. The problem here is that in order to accurately render that pixel, you must combine the contribution from ALL the texels that fit in the pixel. You can't do this if you only look up one texel. And you don't want to have to look up ALL the texels, because that would be too much work to do in order to render a single pixel. Mipmapping reduces the work by generating and keeping around multiple versions of the original texture image, each with lower and lower resolution (thus effectively "larger" texels). When a pixel is to be textured, you must choose the version of the texture image that has the right size texels (relative to the pixel size). Now you have a lot of choices: which texels do you choose, since there are now 8 good possibilities: - you've got the 4 nearest texels in the texture image where the texels are just slightly larger than the current pixel. - you've got the 4 nearest texels in the texture image where the texels are just slightly smaller than the current pixel. If you're making a static image, you can just choose the single closest texel and be done with it. However, for moving images, this result will again produce a lot of aliasing (shimmering again) since a small motion can make the texel chosen by a given pixel "flip" from one to another during successive frames. To do better, you must choose several texels and average the results together. Thus: linear mipmapping: choose one larger one and one smaller one bilinear mipmapping: choose the 4 on the nearest level trilinear mipmapping: choose all 8 By the way, the averaging that's done is not just simple averaging, but rather weighted averaging: the closer a pixel is to a given texel, the higher the contribution of that texel (and vice versa). Is trilinear mipmapping the best you can do? Not at all. You see, the problem is not only the size of the pixel versus the size of the texel, but also in the shape of each (or the relative shape, to be more precise). Mipmapping works best for polygons that face the viewer squarely. That's because each version of the mipmap is produced by combining a square set of pixels from the higher-resolution map to produce the lower-resolution one. Hoewever, polygons which are oblique to the viewer distort the texture map such that pixels can cover all different kinds of quadrilaterally shaped areas of the texture image. Mipmapping doesn't take this into account, and the net effect is that it blurs the texture image too much by using the wrong texels. To get around this problem, you must take samples from even more texels in the texture map, chosen acccording to the shape of the pixel "footprint" in texture space. This is called "anisotropic filtering." Regular mipmapping is called "isotropic" because we always filter together a square region of texels. Anisotropic filtering means that the shape of the region of texels we use varies as circumstances dictate ("an" = not; "iso" = uniform; "tropic" = shape). The Microsoft Talisman architecture can do this to some extent, thus allowing for slightly higher textured image quality. Using more texels of course demands even higher texture memory bandwidth. Remember that all this computation must be done for every pixel of every polygon drawn, or at least for every pixel in the image. ---------------------------------------------------------------------- (c) 1997 Carl Mueller