Advanced
The back texture of the currently active filter. Requires the filter to have blendRequired
set to true.
Applies a filter to a texture.
The filter to apply.
The input texture.
The output render surface.
Whether to clear the output surface before applying the filter.
Generic destroy methods to be overridden by the subclass
Applies filters to a texture.
This method takes a texture and a list of filters, applies the filters to the texture, and returns the resulting texture.
The resulting texture after all filters have been applied.
// Create a texture and a list of filters
const texture = new Texture(...);
const filters = [new BlurFilter(), new ColorMatrixFilter()];
// Apply the filters to the texture
const resultTexture = filterSystem.applyToTexture({ texture, filters });
// Use the resulting texture
sprite.texture = resultTexture;
Key Points:
Copies the last render surface to a texture.
The last render surface to copy from.
The bounds of the area to copy.
Optional
previousBounds: BoundsThe previous bounds to use for offsetting the copy.
System that manages the filter pipeline