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
| name | type | optional | description |
|---|---|---|---|
| camera | Phaser.Cameras.Scene2D.Camera | No | The camera that owns this filter. |
Scope: static
Extends
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 composites the top and bottom FilterList outputs into a single result. It is a standard Phaser.Filters.Blend controller whose blend mode and amount can be configured to control how the two outputs are combined. See Phaser.Filters.Blend for more information.
The texture property of the Blend controller will be overwritten during rendering.
Source: src/filters/ParallelFilters.js#L91
Since: 4.0.0
bottom
bottom: Phaser.GameObjects.Components.FilterList
Description:
The bottom FilterList. Filters added to this list receive the original input and are processed independently from the top list. The final output of this list serves as the base image onto which the top output is blended by the Blend controller.
Source: src/filters/ParallelFilters.js#L79
Since: 4.0.0
top
top: Phaser.GameObjects.Components.FilterList
Description:
The top FilterList. Filters added to this list receive the original input and are processed independently from the bottom list. The final output of this list is passed to the Blend controller as a blend texture, which is then composited onto the bottom output.
Source: src/filters/ParallelFilters.js#L67
Since: 4.0.0
Inherited Methods
From Phaser.Filters.Controller: