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

PointEffectSourceMixin

Hierarchy (View Summary)

Constructors

Properties

ratio: number = 1

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

_initializeShaderKeys: string[] = ...
_refreshUniformsKeys: string[] = ...
defaultData: any = ...

Effect source default data.

EDGE_OFFSET: number = -8

The offset in pixels applied to create soft edges.

effectsCollection: string = "lightSources"
sourceType: string = "light"
_brightLightingLevel: string = LIGHTING_LEVELS.BRIGHT

The corresponding lighting levels for bright light.

_dimLightingLevel: number = LIGHTING_LEVELS.DIM

The corresponding lighting levels for dim light.

Accessors

  • get requiresEdges(): boolean

    Returns boolean

  • get _layers(): {
        background: {
            blendMode: string;
            defaultShader: typeof AdaptiveBackgroundShader;
        };
        coloration: {
            blendMode: string;
            defaultShader: typeof AdaptiveColorationShader;
        };
        illumination: {
            blendMode: string;
            defaultShader: typeof AdaptiveIlluminationShader;
        };
    }

    Returns {
        background: {
            blendMode: string;
            defaultShader: typeof AdaptiveBackgroundShader;
        };
        coloration: {
            blendMode: string;
            defaultShader: typeof AdaptiveColorationShader;
        };
        illumination: {
            blendMode: string;
            defaultShader: typeof AdaptiveIlluminationShader;
        };
    }

  • get ANIMATIONS(): LightSourceAnimationConfig
    Protected

    The corresponding animation config.

    Returns LightSourceAnimationConfig

Methods

  • Parameters

    • changes: any

    Returns void

  • Returns void

  • Returns any

  • An animation with flickering ratio and light intensity

    Parameters

    • dt: number

      Delta time

    • Optionaloptions: {
          amplification?: number;
          intensity?: number;
          reverse?: boolean;
          speed?: number;
      } = {}

      Additional options which modify the flame animation

      • Optionalamplification?: number

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

      • Optionalintensity?: number

        The animation intensity, from 1 to 10

      • Optionalreverse?: boolean

        Reverse the animation direction

      • Optionalspeed?: number

        The animation speed, from 0 to 10

    Returns void

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

    Parameters

    • dt: number

      Delta time

    • Optionaloptions: { intensity?: number; reverse?: boolean; speed?: number } = {}

      Additional options which modify the pulse animation

      • Optionalintensity?: number

        The animation intensity, from 1 to 10

      • Optionalreverse?: boolean

        Reverse the animation direction

      • Optionalspeed?: number

        The animation speed, from 0 to 10

    Returns void

  • A sound-reactive animation that uses bass/mid/treble blending to control certain shader uniforms. "speed" is interpreted as how quickly we adapt to changes in audio. No time-based pulsing is used by default, but we incorporate dt into smoothing so that behavior is consistent across varying frame rates.

    Parameters

    • dt: number

      The delta time since the last frame, in milliseconds.

    • Optionaloptions: { intensity?: number; reverse?: boolean; speed?: number } = {}

      Additional options for customizing the audio reaction.

      • Optionalintensity?: number

        A blend factor in [0..10] that transitions from bass (near 0) to treble (near 10) Mid frequencies dominate around intensity=5.

      • Optionalreverse?: boolean

        Whether to invert the final amplitude as 1 - amplitude.

      • Optionalspeed?: number

        A smoothing factor in [0..10], effectively updates/second.

    Returns void

  • An animation with flickering ratio and light intensity.

    Parameters

    • dt: number

      Delta time

    • Optionaloptions: { intensity?: number; reverse?: boolean; speed?: number } = {}

      Additional options which modify the flame animation

      • Optionalintensity?: number

        The animation intensity, from 1 to 10

      • Optionalreverse?: boolean

        Reverse the animation direction

      • Optionalspeed?: number

        The animation speed, from 0 to 10

    Returns void

  • Protected

    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?