Texture addressing Modes
You may have noticed the assignment of Samplerstate object Members Addressu = wrap and ADDRESSV = Wrap in texturemapping.fx. This is the texture addressing mode, and when the texture coordinates are out of range [0, 1], you can control how they should be displayed. Direct3D supports four kinds of texture addressing modes: Wrap,mirror,clamp,border.
Wrap
In wrap addressing mode, the texture is treated as a vertex coordinates duplicate mapping in parts other than the range [0, 1]. For example, to map a texture to a quadrilateral, the Uvs coordinate of the quadrilateral is (0.0,0.0), (3.0,0.0), (0.0,3.0), (3.3,3.3), and the result of the mapping is repeated 3 times in the direction of the UV two axes. Figure 5.8 illustrates this situation.
Figure 5.8 A Textured Quad in wrap texture address mode. (Texture by Brian maricle.)
Attention:
In Figure 5.8, the black border around the texture map is part of the actual texture, not created during the wrap addressing process. The black border is only marked with an integer boundary for wrap addressing.
Mirror
The mirror addressing mode is very similar to the wrap addressing mode, where the adjacent textures are mirrored rather than repeated at the integer boundary. The result of using the mirror addressing pattern in the same texture quadrilateral is shown in Figure 5.9.
Figure 5.9 A Textured Quad in mirror texture address mode. (Texture by Brian maricle.)
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/extra/