D3D10_SAMPLER_DESC structure (d3d10.h)

Describes a sampler state.

Syntax

typedef struct D3D10_SAMPLER_DESC {
  D3D10_FILTER               Filter;
  D3D10_TEXTURE_ADDRESS_MODE AddressU;
  D3D10_TEXTURE_ADDRESS_MODE AddressV;
  D3D10_TEXTURE_ADDRESS_MODE AddressW;
  FLOAT                      MipLODBias;
  UINT                       MaxAnisotropy;
  D3D10_COMPARISON_FUNC      ComparisonFunc;
  FLOAT                      BorderColor[4];
  FLOAT                      MinLOD;
  FLOAT                      MaxLOD;
} D3D10_SAMPLER_DESC;

Members

Filter

Type: D3D10_FILTER

Filtering method to use when sampling a texture (see D3D10_FILTER).

AddressU

Type: D3D10_TEXTURE_ADDRESS_MODE

Method to use for resolving a u texture coordinate that is outside the 0 to 1 range (see D3D10_TEXTURE_ADDRESS_MODE).

AddressV

Type: D3D10_TEXTURE_ADDRESS_MODE

Method to use for resolving a v texture coordinate that is outside the 0 to 1 range.

AddressW

Type: D3D10_TEXTURE_ADDRESS_MODE

Method to use for resolving a w texture coordinate that is outside the 0 to 1 range.

MipLODBias

Type: FLOAT

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

Type: UINT

Clamping value used if D3D10_FILTER_ANISOTROPIC or D3D10_FILTER_COMPARISON_ANISOTROPIC is specified in Filter. Valid values are between 1 and 16.

ComparisonFunc

Type: D3D10_COMPARISON_FUNC

A function that compares sampled data against existing sampled data. The function options are listed in D3D10_COMPARISON_FUNC.

BorderColor[4]

Type: FLOAT

Border color to use if D3D10_TEXTURE_ADDRESS_BORDER is specified for AddressU, AddressV, or AddressW. Range must be between 0.0 and 1.0 inclusive.

MinLOD

Type: FLOAT

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

Type: FLOAT

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 D3D10_FLOAT32_MAX.

Remarks

These are the default values for sampler state.

State Default Value
Filter Min_Mag_Mip_Point
AddressU Clamp
AddressV Clamp
AddressW Clamp
MinLOD 0.0f
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

Requirements

Requirement Value
Header d3d10.h

See also

Core Structures