D3d11_texture_address_mode (texture addressing mode)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.