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
Name | Type | Default | Description |
parameters | table | |
Parameters for the sampler.
|
.filter | table | '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.
|
.wrap | table | '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] | WrapMode | |
The "z" wrap mode for 3D textures.
|
.compare | CompareMode | 'none' |
The compare mode of the sampler (for shadow samplers).
|
.anisotropy | number | 1 |
The maximum amount of anisotropic filtering to use.
|
.mipmaprange | table | |
A table of 2 mipmap levels the sampler will clamp to.
|
Returns
Name | Type | Description |
sampler | Sampler |
The new sampler.
|
See also