Used to create a GPUSampler and its associated SamplerBinding.

// set our main GPUCurtains instance
const gpuCurtains = new GPUCurtains({
container: '#canvas' // selector of our WebGPU canvas container
})

// set the GPU device
// note this is asynchronous
await gpuCurtains.setDevice()

const mirrorSampler = new Sampler(gpuCurtains, {
label: 'Mirror sampler',
name: 'mirrorSampler',
addressModeU: 'mirror-repeat',
addressModeV: 'mirror-repeat',
})

Constructors

Properties

type: string

The type of the Sampler.

uuid: string

The universal unique id of this Sampler.

renderer: Renderer

Renderer used by this Sampler.

label: string

The label of the Sampler, used to create the GPUSampler. Useful for debugging purpose.

name: string

Name of the Sampler to use in the binding.

Options used to create this Sampler.

sampler: GPUSampler

GPUSampler used.

binding to pass to a bind group.

Methods