Share via


Texture Filtering (Windows Embedded CE 6.0)

1/6/2010

When Microsoft® Direct3D® Mobile renders a primitive, it maps the 3-D primitive onto a 2-D screen. If the primitive has a texture, Direct3D Mobile must use that texture to produce a color for each pixel in the primitive's 2-D rendered image. For every pixel in the primitive's on-screen image, it must obtain a color value from the texture. This process is called texture filtering.

When a texture filter operation is performed, the texture being used is typically also being magnified or minified. In other words, it is being mapped onto a primitive image that is larger or smaller than itself. Magnification of a texture can result in many pixels being mapped to one texel. The result can be a chunky appearance. Minification of a texture often means that a single pixel is mapped to many texels. The resulting image can be blurry or aliased. To resolve these problems, some blending of the texel colors must be performed to arrive at a color for the pixel.

Direct3D Mobile simplifies the complex process of texture filtering. It provides you with three types of texture filtering — linear filtering, anisotropic filtering, and mipmap filtering. If you select no texture filtering, Direct3D Mobile uses a technique called nearest-point sampling.

Each type of texture filtering has advantages and disadvantages. For instance, linear texture filtering can produce jagged edges or a chunky appearance in the final image. However, it is a computationally low-overhead method of texture filtering. Filtering with mipmaps usually produces the best results, especially when combined with anisotropic filtering. However, it requires the most memory of the techniques that Direct3D Mobile supports.

Applications that use texture interface pointers should set the current texture filtering method by calling the IDirect3DMobileDevice::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 one of the D3DMTEXTURESTAGESTATETYPE enumeration values D3DMTSS_MAGFILTER, D3DMTSS_MINFILTER, or D3DMTSS_MIPFILTER for the second parameter to set the magnification, minification, or mipmapping filter. Pass a member of the D3DMTEXTUREFILTERTYPE enumerated type as the value in the third parameter to set the magnification, minification, or mipmapping filter.

The following topics present the texture filtering methods that Direct3D Mobile supports.

See Also

Concepts

Textures