The default coloration shader used by standard rendering and animations. A fragment shader which creates a solid light source.

Hierarchy (view full)

Properties

initialUniforms: object

The initial values of the shader uniforms.

defaultUniforms: {
    intensity: number;
    color: [number, number, number];
    screenDimensions: number[];
    time: number;
    primaryTexture: any;
    depthTexture: any;
    visionTexture: any;
    darknessLevelTexture: any;
    depthElevation: number;
    ambientBrightest: number[];
    ambientDarkness: number[];
    ambientDaylight: number[];
    weights: number[];
    dimLevelCorrection: number;
    brightLevelCorrection: number;
    borderDistance: number;
    darknessLevel: number;
    computeIllumination: boolean;
    globalLight: boolean;
    globalLightThresholds: number[];
    enableVisionMasking: boolean;
} = ...

Type declaration

  • intensity: number
  • color: [number, number, number]
  • screenDimensions: number[]
  • time: number
  • primaryTexture: any
  • depthTexture: any
  • visionTexture: any
  • darknessLevelTexture: any
  • depthElevation: number
  • ambientBrightest: number[]
  • ambientDarkness: number[]
  • ambientDaylight: number[]
  • weights: number[]
  • dimLevelCorrection: number
  • brightLevelCorrection: number
  • borderDistance: number
  • darknessLevel: number
  • computeIllumination: boolean
  • globalLight: boolean
  • globalLightThresholds: number[]
  • enableVisionMasking: boolean
FRAGMENT_END: string = ...

Shader final

FRAGMENT_BEGIN: string = ...

Initialize fragment with common properties

SHADER_HEADER: string = ...

Memory allocations for the Adaptive Background Shader

fragmentShader: string = ...

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

forceDefaultColor: boolean = false

Has this lighting shader a forced default color?

VERTEX_ATTRIBUTES: string = ...

Common attributes for vertex shaders.

VERTEX_UNIFORMS: string = ...

Common uniforms for vertex shaders.

VERTEX_FRAGMENT_VARYINGS: string = ...

Common varyings shared by vertex and fragment shaders.

VERTEX_FUNCTIONS: string = ""

Common functions used by the vertex shaders.

Abstract

FRAGMENT_UNIFORMS: string = ...

Common uniforms shared by fragment shaders.

FRAGMENT_FUNCTIONS: string = ...

Common functions used by the fragment shaders.

Abstract

CONSTANTS: string = ...

Inherit Doc

vertexShader: string = ...

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

CONTRAST: string = ...

Contrast adjustment

SATURATION: string = ...

Saturation adjustment

EXPOSURE: string = ...

Exposure adjustment

SWITCH_COLOR: string = ...

Switch between an inner and outer color, by comparing distance from center to ratio Apply a strong gradient between the two areas if attenuation uniform is set to true

SHADOW: string = ...

Shadow adjustment

TRANSITION: string = ...

Transition between bright and dim colors, if requested

FALLOFF: string = ...

Incorporate falloff if a attenuation uniform is requested

COMPUTE_ILLUMINATION: string = ...

Compute illumination uniforms

SHADER_TECHNIQUES: Record<string, ShaderTechnique> = ...

A mapping of available shader techniques

Accessors

  • get isRequired(): boolean
  • Flag whether the darkness shader is currently required. Check vision modes requirements first, then if key uniforms are at their default values, we don't need to render the background container.

    Returns boolean

  • get COLORATION_TECHNIQUES(): string
  • The coloration technique coloration shader fragment

    Returns string

  • get ILLUMINATION_TECHNIQUES(): string
  • The coloration technique illumination shader fragment

    Returns string

  • get BACKGROUND_TECHNIQUES(): string
  • The coloration technique background shader fragment

    Returns string

  • get ADJUSTMENTS(): string
  • The adjustments made into fragment shaders

    Returns string

Methods

  • Protected Internal

    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

  • Construct adaptive shader according to shader type

    Parameters

    • shaderType: string

      shader type to construct : coloration, illumination, background, etc.

    Returns string

    the constructed shader adaptive block