FilterBarrel
A RenderNode that applies a barrel (or pincushion) distortion effect to a WebGL render target. Barrel distortion warps the image as though it were projected onto a curved surface: positive amounts bow the edges outward (barrel), while negative amounts pinch them inward (pincushion). It is commonly used to simulate fisheye lenses, VR screen curvature, or retro CRT monitor effects.
This node is used internally by the Phaser.Filters.Barrel filter controller, which exposes the amount property for controlling the strength and direction of the distortion.
Constructor
new FilterBarrel(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/FilterBarrel.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 shader uniforms required by the barrel distortion fragment shader. Reads the amount value from the filter controller and passes it to the GPU program, where it controls the strength and direction of the distortion applied to the render target.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| controller | Phaser.Filters.Barrel | No | The filter controller providing the amount uniform value. |
| drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The current drawing context. |
Overrides: Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader#setupUniforms
Source: src/renderer/webgl/renderNodes/filters/FilterBarrel.js#L42
Since: 4.0.0
Inherited Members
From Phaser.Renderer.WebGL.RenderNodes.BaseFilterShader:
From Phaser.Renderer.WebGL.RenderNodes.RenderNode: