Note: This article has been converted from Kristof's old PowerVR Site, however it bears relavence to several other cards that support Anisotropic filtering (Wavey - 28/01/2001)

Texture Filtering : The basic Idea

To understand the differences between the different filtering algorithms you should first understand what filtering tries to do. Your screen has a certain resolution, and the screen is build up from what is called pixels, the resolution determines the number of pixels. Now the 3D card has to determine the color of each of those pixels. The basis for the colors is found in texture maps that are mapped onto polygons that are situated in 3D space. A texture map is build up from pixels that we call texels. These texels are the pixels of a 2D image that is mapped on to the 3D surface. The big question now is : which texel(s) determine the color of the screen pixel?

You should imagine the problem like this : imagine that your screen is a plate with a lot of holes in it (lets assume that pixels are round). Each hole is a pixel. If you look through one of these holes you see what color it has based on the 3D scene that is lying behind that plate. Now imagine a light beam going through one of those holes that hits the texture mapped polygon that is lying behind it. If the polygon is parallel with the screen (the plate with holes) than the light will give you a round highlight (type 1) . Now with some imagination you can let the polygon rotate around its axis and basic knowledge should tell you that the shape of the highlight will go from round to elliptical (type 2 and 3). You are probably wondering what that highlight has got to do with determining the color of the pixel. Well all polygons situated in this highlight determine the color of the pixel. All of this is the basic you need to have to understand the different filtering algorithms.

You can see the different shapes of the highlight in the following figures:

1. Point Sampling

This is the most basic way of determining the color of a pixel from the texture maps. You will just take the pixel closest to the center of your highlight. So you actually make an error since more texels determine the color of the pixel but you just take one. You also do not take into account that the shape of the highlight changes. The big advantage is memory bandwidth : to determine the color of the pixel you just need to fetch one texel from the texture memory. A big disadvantage is the fact that when the polygon gets close to the screen (camera) you have more pixels than texels, and this results in blocky images and general poor quality. However the biggest idea behind filtering is not when to improve quality when you get close to a polygon but to avoid aliasing effects in the depth!

2. Bi-Linear Filtering

Bi-Linear filtering uses an interpolation technique, it uses the basic highlight shape : the circle, to determine which texels the system uses to interpolate. It actually approximates the circle with 4 texels. This system is a big improvement over point sampling since it takes the shape of the highlight partially into account and uses interpolation. This means that if the polygon comes very close to the screen (camera) that the interpolation will make up more texels than are available : this makes nice looking blurred images, however this is a side effect. Disadvantage is that this approximation is only correct for polygons that are parallel to the screen, when you have a polygon under an angle (99% chance) you use a wrong approximation : you use the circle when you should be using an elliptical approximation. A big problem is that this system requires 4 texels to be read from the texture memory so the bandwidth goes up with a factor 4 compared with point sampling.

3. Tri-Linear filtering

Tri-Linear filtering adds the idea of Mip-Mapping to Bi-Linear filtering. You actually perform Bi-Linear filtering in 2 Mip-Levels, those give you 2 texels, one for each mip-level the actual pixel-color is determined by doing another interpolation between the two mip-map colors.The miplevels are actually pre-calculates smaller version of the original texture map, these give a better approximation of the texels that are situated in the highlight. This technique gives again better filtering but has only minor advantages over Bi-Linear filtering. The bandwidth again doubles when you use this technology since you have to read 8 texels from texture memory. Mipmapping does help by giving you a better approximation (it uses more texels that are inside the highlight) of all the texels in the highlight by using pre-calculated Mip-maps.

4. Anisotropic filtering

Now to get really good results you should remember that all the texels in the highlight determine the color of the pixel and you should remember that the shape of the highlight changes shape with the angle of the polygon. Until now we have only used 4 pixels instead of all the pixels in the highlight, this means that all those filtering techniques give you a garbled mess when a polygon is further away from the camera (you don't use enough info : Nyquist criteria ! ), you actually filter to much in one direction and not enough in the other direction. The only advantage until now is the fact that when you get close to the camera the image looks less blocky (this is actually a side effect). So for best quality we should look at all the texels in the highlight and make an average of them, this is however a big hit on your bandwidth and rather hard to do. You can use various filter shapes that approximate the form of the ellipse for the several possible angles of the polygon. There are techniques like that that use between 16 and 32 texels from the texture maps. Using this requires an even bigger memory bandwidth and this is almost impossible on traditional rendering system, unless you use a very expensive memory architecture. Tile based rendering however save a lot of bandwidth and this allows the implementation of Anisotropic filtering. Anisotropic rendering will give a big visual improvement by giving you better depth detail and an accurate representation of texture maps on polygons that are not parallel with the screen.