Skip to main content
Version: Phaser v4.0.0

Phaser.Renderer.WebGL.WebGLStencilParametersFactory

Scope: static

Source: src/renderer/webgl/parameters/WebGLStencilParametersFactory.js#L7
Since: 4.0.0

Static functions

create

<instance> create(renderer, [enabled], [func], [funcRef], [funcMask], [opFail], [opZfail], [opZpass], [clear])

Description:

Creates a new WebGLStencilParameters object that encapsulates the full stencil buffer configuration for a WebGL render pass. The returned object groups the arguments into the three sub-objects expected by the renderer: func (passed to gl.stencilFunc), op (passed to gl.stencilOp), and clear (the value written when the stencil buffer is cleared). All parameters are optional and fall back to sensible no-op defaults so the stencil buffer behaves as if it were disabled.

Parameters:

nametypeoptionaldefaultdescription
rendererPhaser.Renderer.WebGL.WebGLRendererNoThe WebGLRenderer to create the WebGLStencilParameters for.
enabledGLbooleanYesfalseWhether the stencil test is enabled.
funcGLenumYes"GL_ALWAYS"The stencil comparison function used to compare the reference value against the current stencil buffer value.
funcRefGLintYes0The reference value against which the stencil buffer value is compared during the stencil test.
funcMaskGLuintYes"0xFF"The bitwise mask applied to both the reference value and the stencil buffer value before they are compared.
opFailGLenumYes"GL_KEEP"The operation to perform if the stencil test fails.
opZfailGLenumYes"GL_KEEP"The operation to perform if the stencil test passes but the depth test fails.
opZpassGLenumYes"GL_KEEP"The operation to perform if the stencil test passes and the depth test passes or is disabled.
clearGLintYes0The value to clear the stencil buffer to.

Returns: Phaser.Types.Renderer.WebGL.WebGLStencilParameters - The created WebGLStencilParameters.

Source: src/renderer/webgl/parameters/WebGLStencilParametersFactory.js#L19
Since: 4.0.0