Options used to create a Sampler

interface SamplerOptions {
    label?: string;
    type?: GPUSamplerBindingType;
    addressModeU?: GPUAddressMode;
    addressModeV?: GPUAddressMode;
    addressModeW?: GPUAddressMode;
    magFilter?: GPUFilterMode;
    minFilter?: GPUFilterMode;
    mipmapFilter?: GPUMipmapFilterMode;
    lodMinClamp?: number;
    lodMaxClamp?: number;
    compare?: GPUCompareFunction;
    maxAnisotropy?: number;
}

Hierarchy (view full)

  • Partial<GPUSamplerDescriptor>
  • GPUSamplerBindingLayout

Properties

label?: string

The initial value of GPUObjectBase#label|GPUObjectBase.label.

type?: GPUSamplerBindingType

Indicates the required type of a sampler bound to this bindings.

addressModeU?: GPUAddressMode
addressModeV?: GPUAddressMode
addressModeW?: GPUAddressMode

Specifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively.

magFilter?: GPUFilterMode

Specifies the sampling behavior when the sampled area is smaller than or equal to one texel.

minFilter?: GPUFilterMode

Specifies the sampling behavior when the sampled area is larger than one texel.

mipmapFilter?: GPUMipmapFilterMode

Specifies behavior for sampling between mipmap levels.

lodMinClamp?: number
lodMaxClamp?: number

Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture.

compare?: GPUCompareFunction

When provided the sampler will be a comparison sampler with the specified GPUCompareFunction. Note: Comparison samplers may use filtering, but the sampling results will be implementation-dependent and may differ from the normal filtering rules.

maxAnisotropy?: number

Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is enabled when GPUSamplerDescriptor#maxAnisotropy is > 1 and the implementation supports it. Anisotropic filtering improves the image quality of textures sampled at oblique viewing angles. Higher GPUSamplerDescriptor#maxAnisotropy values indicate the maximum ratio of anisotropy supported when filtering.

Most implementations support GPUSamplerDescriptor#maxAnisotropy values in range between 1 and 16, inclusive. The used value of GPUSamplerDescriptor#maxAnisotropy will be clamped to the maximum value that the platform supports. The precise filtering behavior is implementation-dependent.