Recently I am studying d3d11 and see the following:
Zookeeper
Samplerstate samcolor
{
Filter = min_mag_mip_linear;
Addressu = clamp;
Addressv = clamp;
};
I don't quite understand. I checked the related d3d11sdk and some other materials. The summary is as follows:
In d3d11, the texture coordinate system consists of the Horizontal U axis and the vertical v axis. The U and V coordinate systems determine each pixel of the texture; the value range of U and V is [0, 1]. In fact, the texture coordinate can exceed this value, which is defined through the direct3d addressing mode. Generally, there are five addressing modes. The data structure defined by the two modes is as follows:
Identify a technique for resolving texture coordinates that are outside of the boundaries of a texture.
typedef enum D3D11_TEXTURE_ADDRESS_MODE{ D3D11_TEXTURE_ADDRESS_WRAP = 1, D3D11_TEXTURE_ADDRESS_MIRROR = 2, D3D11_TEXTURE_ADDRESS_CLAMP = 3, D3D11_TEXTURE_ADDRESS_BORDER = 4, D3D11_TEXTURE_ADDRESS_MIRROR_ONCE = 5,} D3D11_TEXTURE_ADDRESS_MODE;
Each mode has the following functions:
Wrap: Repeat the original problem on the coordinates beyond the range of [0, 1;
Mirror: replace the original texture image with the coordinates beyond the range of [0, 1;
Clamp: Replace the texture coordinates (u, v) closest to [0, 1] beyond the coordinates in the range [0, 1;
Border: In the coordinates beyond the range of [0, 1], a boundary color is used instead. The boundary color needs to be set in textureaddress. border;
Performance_once: the combination of mirror and clamp is similar to that of coordinates beyond the range of [0, 1. Take the absolute value of the texture coordinate, so the image is centered on the origin, and then the maximum value is truncated;
Zookeeper
D3d11_texture_address_mode (texture addressing mode)