Skip to main content
Version: Phaser v4.0.0

FilterPanoramaBlur

This RenderNode renders the PanoramaBlur filter effect, which applies a radial blur that simulates the distortion seen at the edges of wide-angle or panoramic lenses. The blur is controlled by a radius and a power value, and uses configurable horizontal and vertical sample counts to balance quality against performance. Higher sample counts produce smoother results at the cost of GPU time.

This node manages a dynamic shader addition that injects the sample count as preprocessor defines (SAMPLES_X and SAMPLES_Y) into the fragment shader, so the correct variant is compiled and cached automatically.

See Phaser.Filters.PanoramaBlur.

Constructor

new FilterPanoramaBlur(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/FilterPanoramaBlur.js#L12
Since: 4.0.0

Inherited Methods

From Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader:

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Methods

setupUniforms

<instance> setupUniforms(controller, _drawingContext)

Description:

Sets the WebGL shader uniforms required by the panorama blur fragment shader. This uploads the blur radius (uRadius) and the blur power (uPower) from the filter controller to the currently active program.

Parameters:

nametypeoptionaldescription
controllerPhaser.Filters.PanoramaBlurNoThe filter controller providing the radius and power values.
_drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe current drawing context (unused by this method).

Overrides: Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader#setupUniforms

Source: src/renderer/webgl/renderNodes/filters/FilterPanoramaBlur.js#L73
Since: 4.0.0


updateShaderConfig

<instance> updateShaderConfig(controller, drawingContext)

Description:

Updates the shader addition that controls the sample counts used by the panorama blur fragment shader. The horizontal and vertical sample counts are read from the controller and injected as SAMPLES_X and SAMPLES_Y preprocessor defines, causing the program manager to compile and cache the appropriate shader variant if it has not been used before.

Parameters:

nametypeoptionaldescription
controllerPhaser.Filters.PanoramaBlurNoThe filter controller providing the sample count values.
drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe current drawing context (unused by this method).

Overrides: Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader#updateShaderConfig

Source: src/renderer/webgl/renderNodes/filters/FilterPanoramaBlur.js#L52
Since: 4.0.0


Inherited Members

From Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader:

From Phaser.Renderer.WebGL.RenderNodes.RenderNode: