Skip to main content
Version: Phaser v4.0.0

PanoramaBlur

The PanoramaBlur Filter Controller.

This filter controller manages the PanoramaBlur effect for a Camera.

PanoramaBlur is a filter for blurring a panorama image. This is intended for use with filters like ImageLight that use a panorama image as the environment map. The blur treats a rectangular map as a sphere, and applies heavy distortion close to the poles to get a correct result. You should not use it for general purpose blurring.

The effect can be very slow, as it uses a grid of samples. Total samples equals samplesX * samplesY. This can get very high, very quickly, so be careful when increasing these values. They don't need to be too high for good results.

By default, the blur is fully diffuse, sampling an entire hemisphere per point. If you reduce the radius, the effect will be more focused. Use this to control different levels of glossiness in objects using environment maps.

A PanoramaBlur effect is added to a Camera via the FilterList component:


const camera = this.cameras.main;



camera.filters.internal.addPanoramaBlur({});

camera.filters.external.addPanoramaBlur({});

Constructor

new PanoramaBlur(camera, [config])

Parameters

nametypeoptionaldescription
cameraPhaser.Cameras.Scene2D.CameraNoThe Camera that owns this filter.
configPhaser.Types.Filters.PanoramaBlurConfigYesThe configuration object for the PanoramaBlur effect.

Scope: static

Extends

Phaser.Filters.Controller

Source: src/filters/PanoramaBlur.js#L10
Since: 4.0.0

Inherited Members

From Phaser.Filters.Controller:


Public Members

power

power: number

Description:

An exponent applied to samples. Power above 1 darkens the samples overall, but bright colors are suppressed less than dark ones, causing them to become relatively more dominant in the result. Power below 1 brightens samples overall, reducing the contrast between bright and dark colors. To simulate an HDR environment with bright sunlight that cannot be represented in sRGB color, use high power.

Source: src/filters/PanoramaBlur.js#L103
Since: 4.0.0


radius

radius: number

Description:

The radius of the blur effect. 1 samples an entire hemisphere; 0 samples a single point.

Source: src/filters/PanoramaBlur.js#L72
Since: 4.0.0


samplesX

samplesX: number

Description:

The number of samples to take along the X axis. More samples produces a more accurate blur, but at the cost of performance. The X axis in a panorama is usually wider than the Y axis.

Altering this value triggers a shader re-compile.

Source: src/filters/PanoramaBlur.js#L81
Since: 4.0.0


samplesY

samplesY: number

Description:

The number of samples to take along the Y axis. More samples produces a more accurate blur, but at the cost of performance.

Altering this value triggers a shader re-compile.

Source: src/filters/PanoramaBlur.js#L92
Since: 4.0.0


Inherited Methods

From Phaser.Filters.Controller: