gameforge - v0.1.12
    Preparing search index...

    Class FilterSystem

    System plugin to the renderer to manage filters.

    The FilterSystem executes the filtering pipeline by rendering the display-object into a texture, applying its [filters]PIXI.Filter in series, and the last filter outputs into the final render-target.

    The filter-frame is the rectangle in world space being filtered, and those contents are mapped into (0, 0, filterFrame.width, filterFrame.height) into the filter render-texture. The filter-frame is also called the source-frame, as it is used to bind the filter render-textures. The last filter outputs to the filterFrame in the final render-target.

    PIXI.Container#renderAdvanced is an example of how to use the filter system. It is a 3 step process:

    push: Use PIXI.FilterSystem#push to push the set of filters to be applied on a filter-target. render: Render the contents to be filtered using the renderer. The filter-system will only capture the contents inside the bounds of the filter-target. NOTE: Using PIXI.Renderer#render is illegal during an existing render cycle, and it may reset the filter system. pop: Use PIXI.FilterSystem#pop to pop & execute the filters you initially pushed. It will apply them serially and output to the bounds of the filter-target.

    PIXI

    Implements

    Index

    Constructors

    • Parameters

      • renderer: Renderer

        The renderer this System works for.

      Returns FilterSystem

    Properties

    activeState: FilterState

    Active state

    defaultFilterStack: FilterState[]

    List of filters for the FilterSystem

    forceClear: boolean

    Whether to clear output renderTexture in AUTO/BLIT mode. See PIXI.CLEAR_MODES.

    globalUniforms: UniformGroup

    This uniform group is attached to filter uniforms when used.

    quad: Quad

    A very simple geometry used when drawing a filter effect to the screen.

    quadUv: QuadUv

    Quad UVs

    renderer: Renderer
    statePool: FilterState[]

    A pool for storing filter states, save us creating new ones each tick.

    texturePool: RenderTexturePool

    Stores a bunch of POT textures used for filtering.

    useMaxPadding: boolean

    Old padding behavior is to use the max amount instead of sum padding. Use this flag if you need the old behavior.

    false
    

    Methods

    • Draws a filter using the default rendering process.

      This should be called only by PIXI.Filter#apply.

      Parameters

      Returns void

    • Binds a renderTexture with corresponding filterFrame, clears it if mode corresponds.

      Parameters

      • filterTexture: RenderTexture

        renderTexture to bind, should belong to filter pool or filter stack

      • OptionalclearMode: CLEAR_MODES

        clearMode, by default its CLEAR/YES. See PIXI.CLEAR_MODES

      Returns void

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

      Use outputMatrix * vTextureCoord in the shader.

      Parameters

      Returns Matrix

      The mapped matrix.

    • Destroys this Filter System.

      Returns void

    • Empties the texture pool.

      Returns void

    • Gets extra render texture to use inside current filter To be compliant with older filters, you can use params in any order

      Parameters

      • Optionalinput: RenderTexture

        renderTexture from which size and resolution will be copied

      • Optionalresolution: number

        override resolution of the renderTexture

      • Optionalmultisample: MSAA_QUALITY

        number of samples of the renderTexture

      Returns RenderTexture

    • Gets a Power-of-Two render texture or fullScreen texture

      Parameters

      • minWidth: number

        The minimum width of the render texture in real pixels.

      • minHeight: number

        The minimum height of the render texture in real pixels.

      • Optionalresolution: number

        The resolution of the render texture.

      • Optionalmultisample: MSAA_QUALITY

        Number of samples of the render texture.

      Returns RenderTexture

      • The new render texture.
    • Returns void

    • Pops off the filter and applies it.

      Returns void

    • Pushes a set of filters to be applied later to the system. This will redirect further rendering into an input render-texture for the rest of the filtering pipeline.

      Parameters

      Returns void

    • Calls texturePool.resize(), affects fullScreen renderTextures.

      Returns void

    • Frees a render texture back into the pool.

      Parameters

      Returns void