DirectX SDK |
Direct3D uses a form of linear texture filtering called bilinear filtering. Like nearest point sampling, bilinear texture filtering first computes a texel address, which is usually not an integer address. Just as in nearest point sampling, if then finds the texel whose integer address is closest the computed address. In addition, the Direct3D rendering module will compute a weighted average of the texels that are immediately above, below, to the left of, and to the right of the nearest sample point.
Select bilinear texture filtering by invoking the IDirect3DDevice7::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. Pass D3DTEXTUREMIPFILTER as the value of the second parameter if you are setting the mipmapping filter. Set the third parameter to D3DTFG_LINEAR if you are setting the magnification filter, D3DTFN_LINEAR if you are setting the minification filter, or D3DTFP_LINEAR if you are setting the mipmap filter. For more information, see Texture Filtering State.
Select bilinear texture filtering by invoking the Direct3DDevice7.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 a member of the CONST_D3DTEXTUREMAGFILTER, CONST_D3DTEXTUREMINFILTER, or CONST_D3DTEXTUREMIPFILTER enumerations in the second parameter to set the magnification, minification, or mipmapping filter. Set the third parameter to D3DTFG_LINEAR if you are setting the magnification filter, D3DTFN_LINEAR if you are setting the minification filter, or D3DTFP_LINEAR if you are setting the mipmap filter. For more information, see Texture Filtering State.