Pass:setStencilWrite

Edit

Sets or disables stencil writes. When stencil writes are enabled, any pixels drawn will update the values in the stencil buffer using the StencilAction set.




Arguments

NameTypeDefaultDescription
actionStencilAction How pixels drawn will update the stencil buffer.
valuenumber1 When using the 'replace' action, this is the value to replace with.
masknumber0xff An optional mask to apply to stencil values before writing.

Returns

Nothing

Arguments

NameTypeDefaultDescription
actionstable A list of 3 stencil actions, used when a pixel fails the stencil test, fails the depth test, or passes the stencil test, respectively.
valuenumber1 When using the 'replace' action, this is the value to replace with.
masknumber0xff An optional mask to apply to stencil values before writing.

Returns

Nothing

Disables stencil writing.

Arguments

None

Returns

Nothing

Notes

By default, stencil writes are disabled.

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