Contents / Previous / Next


Anisotropic Fitering

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 is because the texture mapping mode assumes that the texture space is a square - so isotropic - while in reality it is rather long and narrow - anisotropic. And here is where anisotropic filtering comes into the game which allows to increase texture quality of those textures.

Example code to enable the anisotropic texture filtering extension:

 if( gl.isExtensionAvailable("GL_EXT_texture_filter_anisotropic") )   
  {
    float max[] = new float[1];
    gl.glGetFloatv( GL.GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, max, 0 );

    gl.glTexParameterf( GL.GL_TEXTURE_2D, 
                        GL.GL_TEXTURE_MAX_ANISOTROPY_EXT, 
                        max[0] );
  }