Skip to main content
Version: Phaser v4.0.0-rc.6

ParallelFilters

The Parallel Filters Controller.

This filter controller splits the input into two lists of filters,

runs each list separately, and then blends the results together.

The Parallel Filters effect is useful for reusing an input.

Ordinarily, a filter modifies the input and passes it to the next filter.

This effect allows you to split the input and re-use it elsewhere.

It does not gain performance benefits from parallel processing;

it is a convenience for reusing the input.

The Parallel Filters effect is not a filter itself.

It is a controller that manages two FilterLists,

and the final Blend filter that combines the results.

The FilterLists are named 'top' and 'bottom'.

The 'top' output is applied as a blend texture to the 'bottom' output.

You do not have to populate both lists. If only one is populated,

it will be blended with the original input at the end.

This is useful when you want to retain image data that would be lost

in the filter process.

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


const camera = this.cameras.main;

camera.filters.internal.addParallelFilters();

camera.filters.external.addParallelFilters();

Constructor

new ParallelFilters(camera)

Parameters

nametypeoptionaldescription
cameraPhaser.Cameras.Scene2D.CameraNoThe camera that owns this filter.

Scope: static

Extends

Phaser.Filters.Controller

Source: src/filters/ParallelFilters.js#L12
Since: 4.0.0

Inherited Members

From Phaser.Filters.Controller:


Public Members

blend

blend: Phaser.Filters.Blend

Description:

The Blend filter controller that combines the top and bottom FilterLists.

This is just another filter controller.

See Phaser.Filters.Blend for more information.

The texture property of the Blend controller will be

overwritten during rendering.

Source: src/filters/ParallelFilters.js#L85
Since: 4.0.0


bottom

bottom: Phaser.GameObjects.Components.FilterList

Description:

The bottom FilterList.

Source: src/filters/ParallelFilters.js#L76
Since: 4.0.0


top

top: Phaser.GameObjects.Components.FilterList

Description:

The top FilterList.

Source: src/filters/ParallelFilters.js#L67
Since: 4.0.0


Inherited Methods

From Phaser.Filters.Controller: