Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Texture coordinate wrapping refers to the methodology used to interpolate texture coordinates. In general, texture coordinates are interpolated as if the texture map is planar. By enabling texture map coordinate wrapping, the coordinate is interpolated as if the texture map is a cylinder where 0 and 1 are coincidental. Texture coordinate wrapping may be enabled for each set of texture coordinates, and independently for each coordinate in a set.

With planar interpolation, Direct3D Mobile treats the texture as a 2-D plane, interpolating new texels by taking the shortest route from point A within a texture to point B. If point A represents the u, v position (0.8, 0.7), and point B is at (0.1,0.1), the line of interpolation passes through the interior of the texture and remains entirely with its boundaries. With coordinate wrapping along the u axis turned on, the interpolation from A to B takes place on a cylinder so the line of interpolation still goes from 0.8 to 0.1, but now passes across the seam where 1.0 and 0.0 meet. In both cases, the line of interpolation is along the shortest path within the coordinate space.

You can control wrapping via the render states: D3DMRS_WRAP0, D3DMRS_WRAP1, D3DMRS_WRAP2, and D3DMRS_WRAP3 (see D3DMRENDERSTATETYPE). By default, coordinate wrapping is turned off for all coordinate sets. Each render state corresponds to a particular set of texture coordinates. These render states take a combination of the coordinate wrapping flags to specify which coordinates of each set are wrapped. For more information, see D3DMWRAPCOORD Values. The wrapping flags for coordinate sets and coordinates that do not exist are ignored.

See Also

Concepts

Interpolation