Pass:setSampler

Sets the default Sampler to use when sampling textures. It is also possible to send a custom sampler to a shader using Pass:send and use that instead, which allows customizing the sampler on a per-texture basis.


Pass:setSampler(filter)

Arguments

NameTypeDefaultDescription
filterFilterMode'linear' The default filter mode to use when sampling textures (the repeat wrap mode will be used).

Returns

Nothing


Pass:setSampler(sampler)

Arguments

NameTypeDescription
samplerSampler The default sampler shaders will use when reading from textures.

Returns

Nothing

Notes

The getPixel shader helper function will use this sampler.

Example

function lovr.draw(pass)
  pass:setSampler('nearest') -- activate minecraft mode
  pass:setMaterial(rock)
  pass:cube(x, y, z)
end

See also