StencilOperation

View source

Selects the operation WebGL applies to a stencil value.

Pass the operation for stencil-test failure, depth-test failure, and depth test success to WebGLRenderingContext#stencilOp. The clamped increment and decrement values are exposed as Equal and Increase; wrapping variants are exposed as IncreaseWrap and DecreaseWrap. The package’s exported names and numeric values are preserved exactly, including the Decrease value.

Examples

import { StencilOperation } from '@wimaengine/render-webgl'

gl.stencilOp(
  StencilOperation.Keep,
  StencilOperation.Keep,
  StencilOperation.Replace
)

Variants


Keep

View source

Keeps the current stencil value (0x1E00).

Replace

View source

Replaces the stencil value with the reference value (0x1E01).

Equal

View source

Exposes WebGL’s clamped-increment value (0x1E02) under the Equal name.

Increase

View source

Exposes WebGL’s clamped-decrement value (0x1E03) under the Increase name.

Decrease

View source

Exposes 0x1E04 under the Decrease name; WebGL does not define this as a standard stencil operation.

IncreaseWrap

View source

Increments the stencil value with wrapping (0x8507).

DecreaseWrap

View source

Decrements the stencil value with wrapping (0x8508).