The base shader class for weather shaders.

Hierarchy (view full)

Properties

speed: number = 1

The speed multiplier applied to animation. 0 stops animation.

initialUniforms: object

The initial values of the shader uniforms.

COMPUTE_MASK: string = ...

Compute the weather masking value.

FRAGMENT_HEADER: string = ...

Compute the weather masking value.

commonUniforms: {
    useOcclusion: boolean;
    occlusionTexture: any;
    reverseOcclusion: boolean;
    occlusionWeights: number[];
    useTerrain: boolean;
    terrainTexture: any;
    reverseTerrain: boolean;
    terrainWeights: number[];
    alpha: number;
    tint: number[];
    screenDimensions: [number, number];
    effectDimensions: [number, number];
    depthElevation: number;
    time: number;
} = ...

Common uniforms for all weather shaders.

Type declaration

  • useOcclusion: boolean
  • occlusionTexture: any
  • reverseOcclusion: boolean
  • occlusionWeights: number[]
  • useTerrain: boolean
  • terrainTexture: any
  • reverseTerrain: boolean
  • terrainWeights: number[]
  • alpha: number
  • tint: number[]
  • screenDimensions: [number, number]
  • effectDimensions: [number, number]
  • depthElevation: number
  • time: number
defaultUniforms: any

Default uniforms for a specific class

Abstract

vertexShader: string = ...

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

fragmentShader: string = ""

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

Accessors

  • set scale(scale): void
  • Update the scale of this effect with new values

    Parameters

    • scale: number | {
          x: number;
          y: number;
      }

      The desired scale

    Returns void

Methods

  • Reset the shader uniforms back to their initial values.

    Returns void

  • Create the shader program.

    Returns Program