pixi.js
    Preparing search index...

    Class FilterSystemAdvanced

    System that manages the filter pipeline

    Implements

    Index

    Constructors

    Properties

    renderer: Renderer

    Accessors

    Methods

    • Applies a filter to a texture.

      Parameters

      • filter: Filter

        The filter to apply.

      • input: Texture

        The input texture.

      • output: RenderSurface

        The output render surface.

      • clear: boolean

        Whether to clear the output surface before applying the filter.

      Returns void

    • Multiply input normalized coordinates to this matrix to get sprite texture normalized coordinates.

      Use outputMatrix * vTextureCoord in the shader.

      Parameters

      • outputMatrix: Matrix

        The matrix to output to.

      • sprite: Sprite

        The sprite to map to.

      Returns Matrix

      The mapped matrix.

    • Generic destroy methods to be overridden by the subclass

      Returns void

    • 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.

      Parameters

      • params: { filters: Filter[]; texture: Texture }

        The parameters for applying filters.

        • filters: Filter[]

          The filters to apply.

        • texture: Texture

          The texture to apply filters to.

      Returns 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:

      1. padding is not currently supported here - so clipping may occur with filters that use padding.
      2. If all filters are disabled or skipped, the original texture is returned.