A specialized subclass of the BaseLightSource which is used to render global light source linked to the scene.

Hierarchy (view full)

Constructors

Properties

name: string = ...

Name of this global light source.

Default Value

GlobalLightSource.sourceType
customPolygon: number[] | Polygon = null

A custom polygon placeholder.

ratio: number = 1

A ratio of dim:bright as part of the source radius

sourceType: string = "GlobalLight"
effectsCollection: string = "lightSources"
defaultData: any = ...

Effect source default data.

_initializeShaderKeys: string[] = ...
_refreshUniformsKeys: string[] = ...
EDGE_OFFSET: number = -8

The offset in pixels applied to create soft edges.

_dimLightingLevel: number = LIGHTING_LEVELS.DIM

The corresponding lighting levels for dim light.

_brightLightingLevel: string = LIGHTING_LEVELS.BRIGHT

The corresponding lighting levels for bright light.

Accessors

  • get ANIMATIONS(): LightSourceAnimationConfig
  • Protected

    The corresponding animation config.

    Returns LightSourceAnimationConfig

Methods

  • Returns void

  • Returns void

  • Returns void

  • An animation with flickering ratio and light intensity.

    Parameters

    • dt: number

      Delta time

    • Optional options: {
          speed: number;
          intensity: number;
          reverse: boolean;
      } = {}

      Additional options which modify the flame animation

      • speed: number

        The animation speed, from 0 to 10

      • intensity: number

        The animation intensity, from 1 to 10

      • reverse: boolean

        Reverse the animation direction

    Returns void

  • An animation with flickering ratio and light intensity

    Parameters

    • dt: number

      Delta time

    • Optional options: {
          speed: number;
          intensity: number;
          amplification: number;
          reverse: boolean;
      } = {}

      Additional options which modify the flame animation

      • speed: number

        The animation speed, from 0 to 10

      • intensity: number

        The animation intensity, from 1 to 10

      • amplification: number

        Noise amplification (>1) or dampening (<1)

      • reverse: boolean

        Reverse the animation direction

    Returns void

  • A basic "pulse" animation which expands and contracts.

    Parameters

    • dt: number

      Delta time

    • Optional options: {
          speed: number;
          intensity: number;
          reverse: boolean;
      } = {}

      Additional options which modify the pulse animation

      • speed: number

        The animation speed, from 0 to 10

      • intensity: number

        The animation intensity, from 1 to 10

      • reverse: boolean

        Reverse the animation direction

    Returns void

  • Get corrected level according to level and active vision mode data.

    Parameters

    • level: LIGHTING_LEVELS

    Returns number

    The corrected level.

  • Get corrected color according to level, dim color, bright color and background color.

    Parameters

    • level: LIGHTING_LEVELS
    • colorDim: typeof Color
    • colorBright: typeof Color
    • Optional colorBackground: typeof Color

    Returns typeof Color