Pages

Monday, September 21, 2009

Weekend Coding: Anisotropic Filtering

After a few weeks of inactivity, i finally took some time off over the weekend to implement anisotropic filtering (a long overdue feature) to the engine. Anisotropic filtering has been used in games for a pretty decent amount of time, it is not groundbreaking technology however it is still a nice to have feature (or rather a need to have feature for high quality 3D rendering) to include in a 3D engine. For those wondering what is anisotropic filtering here is a short description taken from wikipedia.

In 3D computer graphics, anisotropic filtering (abbreviated AF) is a method of enhancing the image quality of textures on surfaces that are at oblique viewing angles with respect to the camera where the projection of the texture (not the polygon or other primitive on which it is rendered) appears to be non-orthogonal.

Or in layman's term, it makes the graphics prettier :)

I have included a few screenshots below to show the quality improvement by applying anisotropic filtering. Trilinear and anisotropic filtering 16x was used for figure 1 and 2 respectively. Notice how the ground, brick and roof textures looks much sharper in figure 2 than in figure 1.

Figure 1: Trilinear filtering

Figure 2: Anisotropic filtering 16x

Finally to end this post, i have included another screenshot below showing the comparison between the various levels of anisotropic filtering. Cheers!

Comparison of various level of filtering mode. From left to right: Trilinear, Anisotropic 2x, Anisotropic 4x, Anisotropic 8x, Anisotropic 16x