Skip to main content

StencilOperation

Defines the operations that can be performed on the stencil buffer.

TypeNameInterface Description
EnumDecrementAndClamp

Function: Decrements the current stencil buffer value and clamps it to zero.

EnumDecrementAndWrap

Function: Decrements the current stencil buffer value and wraps it around if necessary.

EnumIncrementAndClamp

Function: the current stencil buffer value and clamps it to the maximum representable unsigned integer.

EnumIncrementAndWrap

Function: Increments the current stencil buffer value and wraps it around if necessary.

EnumInvert

Function: Bitwise inverts the current stencil buffer value.

EnumKeep

Function: Keeps the current value of the stencil buffer.

EnumReplace

Function: Replaces the current stencil buffer value with a reference value.

EnumZero

Function: Sets the stencil buffer to zero.

Examples

DecrementAndClamp

let value = APJS.StencilOperation.DecrementAndClamp;

DecrementAndWrap

let value = APJS.StencilOperation.DecrementAndWrap;

IncrementAndClamp

let value = APJS.StencilOperation.IncrementAndClamp;

IncrementAndWrap

let value = APJS.StencilOperation.IncrementAndWrap;

Invert

let value = APJS.StencilOperation.Invert;

Keep

let value = APJS.StencilOperation.Keep;

Replace

let value = APJS.StencilOperation.Replace;

Zero

let value = APJS.StencilOperation.Zero;

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use StencilOperation here
}
onUpdate(deltaTime: number) {
}
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies