Options used to create a Sampler.

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

Hierarchy (View Summary)

Properties

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.

label?: string

The label of the GPUSampler, useful for debugging purpose.

compare?: GPUCompareFunction

When provided the sampler will be a comparison sampler. See GPUCompareFunction (WebGPU API reference).

maxAnisotropy?: number

Specifies the maximum anisotropy value clamp used by the sampler. See maxAnisotropy (WebGPU API reference).