Sampler

Samplers are objects that control how pixels are read from a texture. They can control whether the pixels are smoothed, whether the texture wraps at the edge of its UVs, and more.

Each Pass has a default sampler that will be used by default, which can be changed using Pass:setSampler. Also, samplers can be declared in shaders using the following syntax:

layout(set = 2, binding = X) uniform sampler mySampler;

A Sampler can be sent to the variable using Pass:send('mySampler', sampler).

The properties of a Sampler are immutable, and can't be changed after it's created.

Constructor

lovr.graphics.newSamplerCreate a new Sampler.

Methods

Sampler:getAnisotropyGet the anisotropy level of the Sampler.
Sampler:getCompareModeGet the compare mode of the Sampler.
Sampler:getFilterGet the filter mode of the Sampler.
Sampler:getMipmapRangeGet the mipmap range of the Sampler.
Sampler:getWrapGet the wrap mode of the Sampler.

See also