This class defines an interface which all shaders utilize.

BaseShaderMixin

Hierarchy (View Summary)

Properties

initialUniforms: object

The initial values of the shader uniforms.

defaultUniforms: object = {}

The default uniform values for the shader. A subclass of AbstractBaseShader must implement the defaultUniforms static field.

fragmentShader: string | (...args: any[]) => string = ""

The raw fragment shader used by this class. A subclass of AbstractBaseShader must implement the fragmentShader static field.

vertexShader: string = ""

The raw vertex shader used by this class. A subclass of AbstractBaseShader must implement the vertexShader static field.

Methods

  • Reset the shader uniforms back to their initial values.

    Returns void

  • Protected

    A one time initialization performed on creation.

    Returns void

  • Protected

    Perform operations which are required before binding the Shader to the Renderer.

    Parameters

    • mesh: DisplayObject

      The mesh display object linked to this shader.

    • renderer: Renderer

      The renderer

    Returns void

  • A factory method for creating the shader using its defined default values

    Parameters

    • initialUniforms: object

    Returns AbstractBaseShader