typedef struct D3D11_SAMPLER_DESC {
D3D11_FILTER Filter;
D3D11_TEXTURE_ADDRESS_MODE AddressU;
D3D11_TEXTURE_ADDRESS_MODE AddressV;
D3D11_TEXTURE_ADDRESS_MODE AddressW;
FLOAT MipLODBias;
UINT MaxAnisotropy;
D3D11_COMPARISON_FUNC ComparisonFunc;
FLOAT BorderColor[4];
FLOAT MinLOD;
FLOAT MaxLOD;
} D3D11_SAMPLER_DESC;
Filter
Filtering method to use when sampling a texture (see D3D11_FILTER).
AddressU
Method to use for resolving a u texture coordinate that is outside the 0 to 1 range (see D3D11_TEXTURE_ADDRESS_MODE).
AddressV
Method to use for resolving a v texture coordinate that is outside the 0 to 1 range.
AddressW
Method to use for resolving a w texture coordinate that is outside the 0 to 1 range.
MipLODBias
Offset from the calculated mipmap level. For example, if Direct3D calculates that a texture should be sampled at mipmap level 3 and MipLODBias is 2, then the texture will be sampled at mipmap level 5.
MaxAnisotropy
Clamping value used if D3D11_FILTER_ANISOTROPIC or D3D11_FILTER_COMPARISON_ANISOTROPIC is specified in Filter. Valid values are between 1 and 16.
ComparisonFunc
A function that compares sampled data against existing sampled data. The function options are listed in D3D11_COMPARISON_FUNC.
BorderColor
Border color to use if D3D11_TEXTURE_ADDRESS_BORDER is specified for AddressU, AddressV, or AddressW. Range must be between 0.0 and 1.0 inclusive.
Xbox-specific information: This field only supports the color black. To get opaque black or opaque white, use the extension structure D3D11X_SAMPLER_DESC. To get other colors, use the extension structure D3D11X_SAMPLER_DESC along with ID3D11DeviceContextX::SetBorderColorPalette.
MinLOD
Lower end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed.
MaxLOD
Upper end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. This value must be greater than or equal to MinLOD. To have no upper limit on LOD set this to a large value such as D3D11_FLOAT32_MAX.
These are the default values for sampler state.
| State | Default Value |
|---|---|
| Filter | MIN_MAG_MIP_LINEAR |
| AddressU | Clamp |
| AddressV | Clamp |
| AddressW | Clamp |
| MinLOD | -3.402823466e+38F (-FLT_MAX) |
| MaxLOD | 3.402823466e+38F (FLT_MAX) |
| MipMapLODBias | 0.0f |
| MaxAnisotropy | 16 |
| ComparisonFunc | Never |
| BorderColor | float4(0.0f,0.0f,0.0f,0.0f) |
| Texture | N/A |
Header: Declared in d3d11_x.h (d3d11.h on other Windows platforms).