Skip to main content
Version: Phaser v4.0.0

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

nametypeoptionaldescription
managerPhaser.Renderer.WebGL.RenderNodes.RenderNodeManagerNoThe manager that owns this RenderNode.

Scope: static

Extends

Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader

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:

nametypeoptionaldescription
controllerPhaser.Filters.ImageLightNoThe filter controller providing the texture references.
texturesArray.<WebGLTexture>NoThe texture slot array to populate.
_drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe 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:

nametypeoptionaldescription
controllerPhaser.Filters.ImageLightNoThe filter controller providing uniform values.
_drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe 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: