Graphics Reference
In-Depth Information
The first parameter is perhaps the most visible of all. The Filter structure member
specifies the type of filtering that will be performed during the sampling process, in several
different scenarios. Texture minification, magnification, and mip-mapping are all different
types of sampling operations to which different filter qualities can be applied.
Texture minification occurs when a texture appears far enough from the viewer that
its individual pixels (often referred to as texels, which is short for texture pixels) are smaller
than the output render target pixels. Because the texels from the texture are smaller than the
screen pixels, the texture can appear to sparkle or pop as multiple texels pass through a pixel
from frame to frame. If an appropriate filtering mechanism is chosen, this effect can largely
be reduced, or even eliminated. Texture magnification occurs in the opposite situation. When
a texture is viewed up close, a single texel will cover multiple screen pixels, resulting in a
"blocky" appearance. In some cases, this is the desired behavior, but in other cases a better
quality image can be produced if the texture is filtered to reduce the visibility of the large
texels. The final texture sampling situation to consider is mip-mapping. We have already dis-
cussed mip-mapping in the discussion of texture resources earlier in this chapter. Essentially,
a mip-map provides a multi-resolution representation of the texture resource, and it is pos-
sible to specify the type of filtering that is performed during the mip-map sampling process.
The description structure has one filter parameter, which indicates that all three of
these filtering scenarios are specified with a single enumeration. The available filtering
modes are shown in Listing 2.48. As you can see, each enumerated filter type specifies how
it will sample the texture under the three conditions mentioned aboveā€”MIN corresponds
to texture minification, MAG corresponds to texture magnification, and MIP corresponds to
texture mip-mapping.
enum D3D11_FILTER {
D3D11_FTLTER_MIN_MAG_MIP_P0INT,
D3D11_FILTER_MIN_MAG_P0INT_MIP_LINEAR,
D3D11_FILTER_MIN_P0INT_MAG_LINEAR_MIP_P0INT,
D3D11_FILTER_MIN_P0INT_MAG_MIP_LINEAR J
D3D11_FILTER_MIN_LINEAR_MAG_MIP_P0INT J
D3D11_FILTER_MIN_LINEAR_MAG_P0INT_MIP_LINEAR J
D3D11_FILTER_MIN_MAG_LINEAR_MIP_P0INT J
D3D11_FILTER_MIN_MAG_MIP_LINEAR J
D3Dll_FTLTER_ANISOTROPIC,
D3Dll_FILTER_COMPARISON_MIN_MAG_MIP_POINT,
D3Dll_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR,
D3Dll_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT J
D3D11_FILTER_C0MPARIS0N_MIN_P0INT_MAG_MIP_LINEAR,
D3D11_FILTER_C0MPARIS0N_MIN_LINEAR_MAG_MIP_P0INT,
D3Dll_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR,
D3Dll_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT J
D3Dll_FILTER_COMPARISON_MTN_MAG_MIP_LINEAR J
D3Dll_FILTER_COMPARISON_ANISOTROPIC J
D3D11_FILTER_TEXT_1BIT
}
Listing 2.48. The available filter types in the D3D11_FILTER enumeration.
Search WWH ::




Custom Search