phaser - v4.0.0-rc.4
    Preparing search index...

    The ShaderProgramFactory is a utility class used to generate Phaser.Renderer.WebGL.Wrappers.WebGLProgramWrapper objects. It facilitates generating variants of a shader program based on configuration settings.

    Index

    Constructors

    Properties

    programs: object

    A map of shader programs, identified by a unique key.

    The key of each shader program is made up of the following components:

    • The key of the base shader program.
    • The key of each shader addition, in addition order.
    • The key of each enabled shader feature, sorted alphabetically.
    renderer: WebGLRenderer

    The WebGLRenderer that owns this ShaderProgramFactory.

    Methods

    • Creates a shader program based on the given configuration settings.

      Parameters

      • name: string

        The unique key of the shader program.

      • base: BaseShaderConfig

        The base shader configuration.

      • Optionaladditions: ShaderAdditionConfig[]

        An array of shader addition configurations.

      • Optionalfeatures: string[]

        An array of enabled shader feature keys.

      Returns void

    • Returns a unique key for a shader program based on the given configuration settings.

      The key is made up of the following components:

      • The key of the base shader program.
      • The key of each shader addition, in addition order.
      • The key of each enabled shader feature, sorted alphabetically.

      Parameters

      • base: BaseShaderConfig

        The base shader configuration.

      • Optionaladditions: ShaderAdditionConfig[]

        An array of shader addition configurations.

      • Optionalfeatures: string[]

        An array of enabled shader feature keys.

      Returns void

    • Checks if a shader program exists based on the given configuration settings.

      Parameters

      • key: string

        The unique key of the shader program.

      Returns void