Advanced Texture Mapping


Even though bilinear filtering is excellent at rendering still images, it has problems eliminating the sparkling effect because bilinear filtering does not smoothly transition from the first group of 4 pixels used to the second. This "unsmooth" transition causes sparkling. In order to eliminate sparkling somewhat, a technique called MIP mapping is used. Sparkling is eliminated almost entirely by trilinear filtering.

MIP Mapping

Mip mapping is the process of creating a multiple copies of the same texture, but with different sizes and pre-filtered MORE ACCURATELY THAN BILINEAR FILTERING (Other wise, MIP Mapping would have no effect). What is more accurately? Well, honestly, I don't know what they do, probably just filter at a higher quality (with more precision) or filter with more than the nearest 4 pixels? I don't know, E-mail me if you DO know)

Below is an example of a texture with 3 MIP MAPS generated for it:


                           128x128 original                64x64MIPMAP     32x32 MIPMAP  

The original method of MIP mapping would be to chose the most applicable MIP map (i.e. the one that most closely fits the size of the projected polygon (i.e. the polygon on the screen, which is actually 2D) This method works well when combined with bilinear filtering; however, it is not fully successful in removing shimmering because shimmering can occur because the pixels are chosen from only 1 MIP Map (and the correct pixel is actually on a MIP map in-between the two MIP Maps) In order to fix this problem, we simply blend, not pixels, but with MIP Maps. When we choose the correct pixel, we want it to be chosen from a blend of the two nearest mip maps. This technique is called trilinear filtering.

Trilinear Filtering

Trilinear filtering, as mentioned above is the process of blending the two nearest mip maps and then bilinear filtering by choosing the 4 nearest pixels from the blended mip map. Because we blend, the transitions from one mip map to the next is very smooth. Unfortunately, as with bilinear filtering, smooth, also means blurry. While trilinear filtering virtually eliminates shimmering and sparkling, trilinear filtering causes images to become extremely blurred in the background, especially floor textures. This is why many developers and card manufacturers say that trilinear filtering is not a significant improvement. There is another method; however, which is capable of achieving the smooth images of trilinear filtering, without most of the aliasing (in this case excessive bluriness) which occurs with trilinear filtering..

Anisotrophic Filtering

What Anisotrophic Filtering does is choose the correct pixels for filtering. (i.e. if a polygon is 20 pixels wide and 80 pixels tall in screen space, instead of choosing the nearest 4 pixels in a square fashion, anisotrophic will choose 4 pixels one underneath the other, since this most accurately reflects the polygon being drawn. Why does this work? Well, if we want to find the EXACT color at a certain non integer location, we must actually blend ALL of the pixels in the texture, using the weighted average technique. Unfortunately this is way to slow. In order to speed this up, we only chose the nearest 4 pixels (actually square) and assumed that the others will not have as much of an impact. In reality; however, with thin polygons, it is more accurate to choose 4 pixels which mimic the shape of the polygon (i.e. a thin rectangle = a thin 4 pixel rectangle for filtering; some architectures like PowerVRSG choose more than 4 pixels, which is why it takes 4 clock cycles to "anisotrophically" filter a pixel with PowerVRSG) So, basically, anisotrophic filtering chooses the best pixels to perform a weighted average on, not only pixels in the nearest square. Anisotrophic filtering is starting to make its way into the mainstream accelerator market, being available in the Riva TNT.

Texture Mapping Multitexturing, Blending, etc.

Log in

Don't have an account? Sign up now