What Is Texture Mapping?
Texture mapping is the process of determining where in a particular space a texture will be applied. A texture consists of a series of pixels (also called texels), each occupying a texture coordinate determined by the width and height of the texture. These texture coordinates are then mapped into values ranging from 0 to 1 along a u and v axes (u is width, v is height). This process is called UV mapping. The resulting coordinates are UV coordinates. Whenever you render a polygon, a UV coordinate is calculated for each vertex in the triangle. These three UV coordinates dictate how a texture is applied to the polygon by the pixel shader. When the u or v values move below 0 or above 1, the polygon is applied according to the texture address mode that has been set. When TextureAddressMode.Border is in effect, any pixels where the UV mapping is outside the 0-1 range are colored with the border color. When TextureAddressMode.Clamp is in effect, the color of the nearest pixel is used. Texture