FilterImageLight
This RenderNode renders the ImageLight filter effect, which simulates image-based lighting on a Game Object using an environment map and a normal map. The environment map provides the source lighting information, while the normal map describes the surface orientation of the object, allowing the shader to calculate how light reflects across its surface. This produces a convincing 3D lighting effect within a 2D scene.
Use this node when a Phaser.Filters.ImageLight filter controller is active on a Game Object. It binds the environment and normal textures to the correct sampler slots and uploads the view matrix, model rotation, bulge, and color factor uniforms required by the fragment shader.
See Phaser.Filters.ImageLight.
Constructor
new FilterImageLight(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/FilterImageLight.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 environment map and normal map WebGL textures to their respective texture slots. The environment map is assigned to slot 1 and the normal map to slot 2, matching the sampler uniforms set in Phaser.Renderer.WebGL.RenderNodes.FilterImageLight#setupUniforms.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| controller | Phaser.Filters.ImageLight | No | The filter controller providing the texture references. |
| textures | Array.<WebGLTexture> | No | The texture slot array to populate. |
| _drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The current drawing context (unused). |
Overrides: Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader#setupTextures
Source: src/renderer/webgl/renderNodes/filters/FilterImageLight.js#L43
Since: 4.0.0
setupUniforms
<instance> setupUniforms(controller, _drawingContext)
Description:
Uploads the shader uniforms required by the ImageLight fragment shader. This includes the sampler indices for the environment and normal map textures, the view matrix used to orient the environment map in world space, the model rotation of the filtered object, the bulge factor that controls the spherical distortion of the environment reflection, and the color factor that blends the lighting contribution with the original object color.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| controller | Phaser.Filters.ImageLight | No | The filter controller providing uniform values. |
| _drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The current drawing context (unused). |
Overrides: Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader#setupUniforms
Source: src/renderer/webgl/renderNodes/filters/FilterImageLight.js#L64
Since: 4.0.0
Inherited Members
From Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader:
From Phaser.Renderer.WebGL.RenderNodes.RenderNode: