Pass:setStencilTest

Edit

Sets the stencil test. Any pixels that fail the stencil test won't be drawn. For example, setting the stencil test to ('equal', 1) will only draw pixels that have a stencil value of 1. The stencil buffer can be modified by drawing while stencil writes are enabled with lovr.graphics.setStencilWrite.



Arguments

NameTypeDefaultDescription
testCompareMode The new stencil test to use.
valuenumber The stencil value to compare against.
masknumber0xff An optional mask to apply to stencil values before the comparison.

Returns

Nothing

Disable the stencil test.

Arguments

None

Returns

Nothing

Notes

The stencil test is disabled by default.

Setting the stencil test requires the Pass to have a depth texture with the d24s8 or d32fs8 format (the s means "stencil"). The t.graphics.stencil and t.headset.stencil flags in lovr.conf can be used to request a stencil format for the default window and headset passes, respectively.

See also