lovr.graphics.newSampler

Creates a new Sampler. Samplers are immutable, meaning their parameters can not be changed after the sampler is created. Instead, a new sampler should be created with the updated properties.

sampler = lovr.graphics.newSampler(parameters)

Arguments

NameTypeDefaultDescription
parameterstable Parameters for the sampler.
.filtertable'linear' How the sampler smooths texture pixels. Can be a table of 3 FilterModes, or a single FilterMode to use for all three.
.[1]FilterMode The filter mode to use when minifying a texture (drawing it at a smaller size than its native pixel resolution).
.[2]FilterMode The filter mode to use when magnifying a texture (drawing it at a larger size than its native pixel resolution).
.[3]FilterMode The filter mode used to smooth between mipmap levels in a texture.
.wraptable'repeat' How the sampler behaves when wrapping UVs outside the 0-1 range. Can be a table of 3 WrapModes, or a single WrapMode to use for all three axes.
.[1]WrapMode The horizontal wrap mode.
.[2]WrapMode The vertical wrap mode.
.[3]FilterMode The "z" wrap mode for 3D textures.
.compareCompareMode'none' The compare mode of the sampler (for shadow samplers).
.anisotropynumber1 The maximum amount of anisotropic filtering to use.
.mipmaprangetable A table of 2 mipmap levels the sampler will clamp to.

Returns

NameTypeDescription
samplerSampler The new sampler.

See also