lovr.graphics.stencil

Renders to the stencil buffer using a function.

lovr.graphics.stencil(callback, action, value, keep)

Arguments

NameTypeDefaultDescription
callbackfunctionThe function that will be called to render to the stencil buffer.
actionStencilAction'replace'How to modify the stencil value of pixels that are rendered to.
valuenumber1If action is "replace", this is the value that pixels are replaced with.
keepbooleanfalseIf false, the stencil buffer will be cleared to zero before rendering.

Returns

Nothing


lovr.graphics.stencil(callback, action, value, initial)

Arguments

NameTypeDefaultDescription
callbackfunctionThe function that will be called to render to the stencil buffer.
actionStencilAction'replace'How to modify the stencil value of pixels that are rendered to.
valuenumber1If action is "replace", this is the value that pixels are replaced with.
initialnumber0The value to clear the stencil buffer to before rendering.

Returns

Nothing

Notes

Stencil values are between 0 and 255.

See also