For a list of related topics and for a list of all texture mapping functions, see Texture Mapping.
There are many controls which are applied to a texture map. Texture maps are referenced through a lookup table to allow multiple combinations of control values to be easily applied to the same texture map. See also Texture Mapping Table. The table mechanism also facilitates ensuring control values, many of which are dependent on the specific texture map, are valid.
The rendering control field of the texture mapping lookup table controls whether the texture is applied before or after the primitive is lit.
Several of the fields control parameterization, that is, how texels are mapped to a facet. The parameterization method field specifies how the texture map coordinates for each vertex are determined. (See also Parameterization Controls). The texture map coordinates select a position in the texture map. The portion of a texture map selected by the vertices's texture map coordinates is then applied to the facet. The PEXTMParamVertexCoordMC, PEXTMParamVertexCoordWC, PEXTMParamVertexNormalMC, PEXTMParamVertexNormalWC, PEXTMParamNURBUV, and PEXTMParamFloatData parameterization methods use the vertex, normal, u-v parameterization, or floating-point data list data directly as the texture map coordinates. Field fp data index of the texture mapping lookup table defines the index within the floating-point data list of the first of the consecutive texture mapping coordinates when the parameterization method is PEXTMParamFloatData. The PEXTMParamReflectionSphereVRC and PEXTMParamReflectionSphereWC parameterization methods select texture map coordinates by picking them off a conceptual sphere surrounding the facet. A special reflection vector calculated for each vertex is used to select a point on the sphere. The resulting texture mapping is often called environment mapping since the texturing is view dependent - the facet appears to reflect fixed objects as the facet is moved around. The reflection matrix and hints field of the texture mapping lookup table is applied only when one of these environment mapping parameterization methods is selected. The reflection matrix is used to transform the reflection vectors before they select the texture coordinates from the sphere, which has a fixed orientation.
Independent of the parameterization method used, the texture map coordinates are lastly transformed by the orientation matrix defined by the orientation matrix and hints field of the texture mapping lookup table. After this transformation, a vertex's texture map coordinates are ready to select a position on the texture map. See also Orientation, Transformation, Interpolation, and Perspective Correction.
Another group of fields in the texture mapping lookup table control the sampling of the color mipmap. (See also Sampling Control.) When one pixel corresponds to multiple texels, the min sample method field indicates how the texel data is sampled down to derive a single color value. The mag sample method field controls the opposite case of one pixel corresponding to less than a single texel. The sample methods support a wide range of sampling options to determine the color value, from PEXTMSampleSingleBase, which uses a single texel in the base level of the texture map, to PEXTMSampleWeightedBetweenMipmaps, where the weighted averages of 2n texels on each of the two levels nearest the sample depth are determined, then interpolated to the sample depth. The sampling hints field potentially adjusts the sampling depth, making the texturing more detailed or blurred than it otherwise would have been. It is also used to indicate blurring is unacceptably high due to low spatial frequency in a particular direction in the color mipmap.
Textures sometimes map to something less than the entire facet. The t0, t1, and t2 boundary condition fields specify how the region in each direction outside the mapped texture is handled. PEXlib defines the following boundary conditions:
PEXlib defines the following clamping methods:
For the sampling methods that use multiple texels on a mipmap level to compute a weighted average, it is possible that the neighboring texels do not exist because the implementation is sampling near the texture map boundary. In these cases, the implementation synthesizes the missing texels by using the boundary condition in effect. However, a boundary condition of PEXTMBoundaryClampExplicit with a clamping method of PEXTMBoundaryClampExplicitDiscontinue does not cause the primitive's intrinsic color to be included in the weighted average.
The remaining fields in the texture mapping lookup table specify the blending of the color values derived from the texture map and boundary conditions with the primitive's color. The composition method field specifies how this blending is done: