Skip to main content

StencilState

Class

The stencil test state for Pass.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Index

Extends

Properties

depthFailureOperation

depthFailureOperation: StencilOperation

Specifies the stencil action when the stencil test passes, but the depth test fails.

Since

Lens Scripting Version 152

Default Value

StencilOperation.Keep

depthStencilPassOperation

depthStencilPassOperation: StencilOperation

Specifies the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled.

Since

Lens Scripting Version 152

Default Value

StencilOperation.Keep

enabled

enabled: boolean

Enable or disable the stencil test for pass.

Default Value

false

face

face: StencilFace

Specifies whether the front and/or back face stencil test will be applied.

Since

Lens Scripting Version 152

Default Value

StencilFace.FrontAndBack

readMask

readMask: number

Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done.

Since

Lens Scripting Version 152

Default Value

0xFF

referenceValue

referenceValue: number

Specifies the reference value for the stencil test. It is clamped to the range [0..pow(2, n)−1], where n is the number of bitplanes in the stencil buffer.

Since

Lens Scripting Version 152

Default Value

0

stencilCompareFunction

stencilCompareFunction: StencilFunction

Specifies the stencil test function.

Since

Lens Scripting Version 152

Default Value

StencilFunction.Always

stencilFailureOperation

stencilFailureOperation: StencilOperation

Specifies the action to take when the stencil test fails.

Since

Lens Scripting Version 152

Default Value

StencilOperation.Keep

writeMask

writeMask: number

Specifies a bit mask to enable and disable writing of individual bits in the stencil planes.

Since

Lens Scripting Version 152

Default Value

0xFF

Methods

getTypeName()

static getTypeName(): TypeName<StencilState>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<StencilState>

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame