Anisotropic Texture Filtering

Anisotropy is the distortion visible in the texels of a 3-D object whose surface is oriented at an angle with respect to the plane of the screen. When a pixel from an anisotropic primitive is mapped into texels, its shape is distorted. Direct3D measures the anisotropy of a pixel as the elongation (length divided by width) of a screen pixel that is inverse-mapped into texture space.

Anisotropic texture filtering can be used in conjunction with linear texture filtering or mipmap texture filtering to improve rendering results. Your application enables anisotropic texture filtering by calling the IDirect3DDevice3::SetTextureStageState method. Set the value of the first parameter to the integer index number (0-7) of the texture for which you are selecting a texture filtering method. Pass D3DTEXTUREMAGFILTER as the value of the second parameter if you are setting the magnification filter. Pass D3DTEXTUREMINFILTER as the value of the second parameter if you are setting the minification filter. Set the third parameter to D3DTFG_ANISOTROPIC if you are setting the magnification filter, or D3DTFN_ANISOTROPIC if you are setting the minification filter. For more information, see Texture Filtering State.

Your program must also set the degree of anisotropy to a value greater than zero and less than one. Do this by calling the IDirect3DDevice3::SetTextureStageState method. Set the value of the first parameter to the integer index number (0-7) of the texture for which you are setting the degree of isotropy. Pass D3DTSS_MAXANISOTROPY as the value of the second parameter. The final parameter should be the degree of isotropy.

Disable isotropic filtering by setting the degree of isotropy to one (any value larger than one enables it). Check the D3DPRASTERCAPS_ANISOTROPY flag in the D3DPRIMCAPS structure to determine the possible range of values for the degree of anisotropy.