Back to Filament

setStencilReadMask

docs/android/dokka/filament-android/com.google.android.filament/-material-instance/set-stencil-read-mask.md

1.75.01.3 KB
Original Source

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

setStencilReadMask

[main]
open fun setStencilReadMask(readMask: Int, face: MaterialInstance.StencilFace)

Sets the stencil read mask (default is 0xFF).

The stencil read mask masks the bits of the values participating in the stencil comparison test- both the value read from the stencil buffer and the reference value.

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

Parameters

main

readMaskthe read mask (only the least significant 8 bits are used)
facethe faces to update the read mask for

[main]
open fun setStencilReadMask(readMask: Int)

Sets the stencil read mask for both front and back-facing polygons.

See also

setStencilReadMask(int, StencilFace)