Back to Filament

setStencilReferenceValue

docs/android/dokka/filament-android/com.google.android.filament/-material-instance/set-stencil-reference-value.md

1.75.01.4 KB
Original Source

//filament-android/com.google.android.filament/MaterialInstance/setStencilReferenceValue

setStencilReferenceValue

[main]
open fun setStencilReferenceValue(value: Int, face: MaterialInstance.StencilFace)

Sets the stencil reference value (default is 0).

The stencil reference value is the left-hand side for stencil comparison tests. It's also used as the replacement stencil value when StencilOperation is REPLACE.

It's possible to set separate stencil reference values; one for front-facing polygons, and one for back-facing polygons. The face parameter determines the reference value(s) updated by this call.

Parameters

main

valuethe stencil reference value (only the least significant 8 bits are used)
facethe faces to update the reference value for

[main]
open fun setStencilReferenceValue(value: Int)

Sets the stencil reference value for both front and back-facing polygons.

See also

setStencilReferenceValue(int, StencilFace)