FilterCombineColorMatrix
A RenderNode that applies the Combine Color Matrix filter effect, as defined by Phaser.Filters.CombineColorMatrix.
This effect blends two independent color matrices: one applied to the game object itself (colorMatrixSelf) and one sourced from an external transfer texture (colorMatrixTransfer). Each matrix has its own alpha multiplier, and additional per-channel addition and multiplication values can be supplied to further adjust the final color output.
Use this filter when you need to composite or blend colour-grading from two separate sources in a single WebGL pass, for example combining a base desaturation pass with a tinted overlay texture.
Constructor
new FilterCombineColorMatrix(manager)
Parameters
| name | type | optional | description |
|---|---|---|---|
| manager | Phaser.Renderer.WebGL.RenderNodes.RenderNodeManager | No | The manager that owns this RenderNode. |
Scope: static
Extends
Source: src/renderer/webgl/renderNodes/filters/FilterCombineColorMatrix.js#L12
Since: 4.0.0
Inherited Methods
From Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader:
From Phaser.Renderer.WebGL.RenderNodes.RenderNode:
Public Methods
setupTextures
<instance> setupTextures(controller, textures, _drawingContext)
Description:
Binds the transfer texture required by the shader.
Assigns the controller's pre-rendered GL texture to texture slot 1, which the fragment shader reads via the uTransferSampler uniform as the source for the transfer color matrix pass.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| controller | Phaser.Filters.CombineColorMatrix | No | The filter controller providing the transfer GL texture. |
| textures | Array.<WebGLTexture> | No | The texture array used by the shader. The transfer texture is written to index 1. |
| _drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The current drawing context (unused by this method). |
Overrides: Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader#setupTextures
Source: src/renderer/webgl/renderNodes/filters/FilterCombineColorMatrix.js#L42
Since: 4.0.0
setupUniforms
<instance> setupUniforms(controller, drawingContext)
Description:
Uploads all shader uniforms required by the Combine Color Matrix effect.
Sets the following uniforms on the active shader program:
-
uTransferSampler— texture unit index for the transfer texture. -
uColorMatrixSelf— the 4×5 color matrix applied to the game object itself. -
uColorMatrixTransfer— the 4×5 color matrix applied to the transfer texture. -
uAlphaSelf— the global alpha multiplier for the self color matrix. -
uAlphaTransfer— the global alpha multiplier for the transfer color matrix. -
uAdditions— per-channel additive offsets applied after matrix multiplication. -
uMultiplications— per-channel multiplicative factors applied after matrix multiplication.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| controller | Phaser.Filters.CombineColorMatrix | No | The filter controller supplying color matrix data, alpha values, additions, and multiplications. |
| drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The current drawing context. |
Overrides: Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader#setupUniforms
Source: src/renderer/webgl/renderNodes/filters/FilterCombineColorMatrix.js#L60
Since: 4.0.0
Inherited Members
From Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader:
From Phaser.Renderer.WebGL.RenderNodes.RenderNode: