When using mipmapped textures in your OpenGL applications you might sometimes notice that those textures are often severly blurred when the camera looks at the them from an oblique angle. That's because the texture mapping mode assumes that the texture space is a square - so isotropic - while in reality it's rather long and narrow - anisotropic. And here's where anisotropic filtering comes into the game which allows to increase texture quality of those textures.
So as we are dealing with an extension, it would be better to first check whether this extension is really supported by our graphics driver:
Then we need two defines used by this extension. Either you include glext.h - link can be found in the code section - or you create the defines yourself:
If we are sure that anistropic filtering is supported, we are free to create our textures using this extension. Like setting what MIN_FILTER should be used for this texture, you also do the same here. The corresponding texture attribute is GL_TEXTURE_MAX_ANISOTROPY_EXT:As you see, the maximum anisotropy is a float and it has to be greater than 1.0 when the extension should take effect. The maximum value that is supported by your graphics cards can be retrieved with glGetFloatv(..):
That's it! This extension really belongs to the most easiest ones to use. If you like you can compare filtered and non-filtered textures in the anistropic filtering test app I wrote. At the same time you might see that the effects aren't that overwhelming. Questions? Message Board! Happy Coding!