Texture:setSampler
EditSets sampler settings for the texture. This can either be a FilterMode like nearest, or a Sampler object, which allows configuring all of the filtering and wrapping settings.
There are other ways of using custom samplers for a texture, but they have disadvantages:
Samplerobjects can be sent to shaders and used to sample from the texture, but this requires writing custom shader code and sending sampler objects withPass:send, which is inconvenient.Pass:setSamplerexists, but it applies to all textures in all draws in the Pass. It doesn't allow for changing filtering settings on a per-texture basis.
This API is experimental, and subject to change in the future!
Arguments
| Name | Type | Description |
| mode | FilterMode | The FilterMode shaders will use when reading pixels from the texture. |
Returns
Nothing
Arguments
| Name | Type | Description |
| sampler | Sampler | The Sampler object shaders will use when reading pixels from the texture. |
Returns
Nothing
Remove the texture's sampler, instead using the one set by Pass:setSampler.
Arguments
None
Returns
Nothing