A specialized subclass of the BaseLightSource which renders a source of light as a point-based effect.

Mixes

Hierarchy (view full)

Constructors

Properties

ratio: number = 1

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

effectsCollection: string = "lightSources"
sourceType: string = "light"
_initializeShaderKeys: string[] = ...
_refreshUniformsKeys: string[] = ...
defaultData: any = ...

Effect source default data.

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

    Inherit Doc

  • Parameters

    • changes: any

    Returns void

    Inherit Doc

  • Returns any

    Inherit Doc

  • Test whether this LightSource provides visibility to see a certain target object.

    Parameters

    • config: {
          tests: CanvasVisibilityTest[];
          object: PlaceableObject;
      } = {}

      The visibility test configuration

      • tests: CanvasVisibilityTest[]

        The sequence of tests to perform

      • object: PlaceableObject

        The target object being tested

    Returns boolean

    Is the target object visible to this source?

  • Can this LightSource theoretically detect a certain object based on its properties? This check should not consider the relative positions of either object, only their state.

    Parameters

    • target: PlaceableObject

      The target object being tested

    Returns boolean

    Can the target object theoretically be detected by this vision source?

  • 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

  • Update darkness suppression according to darkness sources collection.

    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