A container group which contains visual effects rendered above the primary group.

TODO: The effects canvas group is now only performing shape initialization, logic that needs to happen at the placeable or object level is now their burden.

  • [DONE] Adding or removing a source from the EffectsCanvasGroup collection.
  • [TODO] A change in a darkness source should re-initialize all overlaping light and vision source.

Hierarchy

  • CanvasGroup<this>
    • EffectsCanvasGroup

Properties

animateLightSources: boolean = true

Whether to currently animate light sources.

animateVisionSources: boolean = true

Whether to currently animate vision sources.

background: undefined | CanvasBackgroundAlterationEffects

A layer of background alteration effects which change the appearance of the primary group render texture.

coloration: undefined | CanvasColorationEffects

A layer which adds color-based effects to the scene.

darkness: undefined | CanvasDarknessEffects

A layer which adds darkness effects to the scene.

darknessSources: any = ...

A mapping of darkness sources which are active within the rendered Scene.

illumination: undefined | CanvasIlluminationEffects

A layer which adds illumination-based effects to the scene.

layers: Record<string, CanvasLayer>

A mapping of CanvasLayer classes which belong to this group.

lightSources: any = ...

A mapping of light sources which are active within the rendered Scene.

visionSources: any = ...

A Collection of vision sources which are currently active within the rendered Scene.

visualEffectsMaskingFilters: Set<VisualEffectsMaskingFilter> = ...

A set of vision mask filters used in visual effects group

groupName: undefined | string

The name of this canvas group.

tearDownChildren: boolean = true

If this canvas group should teardown non-layers children.

Accessors

  • get hookName(): string

    The name used by hooks to construct their hook string. Note: You should override this getter if hookName should not return the class constructor name.

    Returns string

  • get name(): string

    The canonical name of the canvas group is the name of the constructor that is the immediate child of the defined base class.

    Returns string

Methods

  • Parameters

    • options: any

    Returns Promise<void>

  • Parameters

    • options: any

    Returns Promise<void>

  • Activate light source animation for AmbientLight objects within this layer

    Returns void

  • Activate post-processing effects for a certain effects channel.

    Parameters

    • filterMode: string

      The filter mode to target.

    • OptionalpostProcessingModes: string[] = []

      The post-processing modes to apply to this filter.

    • Optionaluniforms: Object = {}

      The uniforms to update.

    Returns void

  • Iterator for all light and darkness sources.

    Returns Generator<any, void, void>

    PointDarknessSource|PointLightSource

  • Animate a smooth transition of the darkness overlay to a target value. Only begin animating if another animation is not already in progress.

    Parameters

    • target: number = 1.0

      The target darkness level between 0 and 1

    • duration: number = {}

      The desired animation time in milliseconds. Default is 10 seconds

    Returns Promise<any>

    A Promise which resolves once the animation is complete

  • Clear all effects containers and animated sources.

    Returns void

  • Deactivate light source animation for AmbientLight objects within this layer

    Returns void

  • Draw the canvas group and all its components.

    Parameters

    • Optionaloptions: object = {}

    Returns Promise<EffectsCanvasGroup>

    A Promise which resolves once the group is fully drawn

  • Get the darkness level at the given point.

    Parameters

    Returns number

    The darkness level.

  • Initialize positive light sources which exist within the active Scene. Packages can use the "initializeLightSources" hook to programmatically add light sources.

    Returns void

  • Initialize all sources that generate edges (Darkness and certain Light sources). Darkness sources always generate edges. Light sources only do so if their priority is strictly greater than 0. The edgesSources array will be rebuilt and sorted by descending priority, in the case of a tie, DarknessSources take precedence. Otherwise, the existing array is used as-is. Regardless of whether the array is rebuilt, each source is re-initialized to ensure their geometry is refreshed.

    Returns void

  • Refresh the active display of lighting.

    Returns void

  • Refresh the state and uniforms of all light sources and darkness sources objects.

    Returns void

  • Refresh the state and uniforms of all VisionSource objects.

    Returns void

  • Reset post-processing modes on all Visual Effects masking filters.

    Returns void

  • Remove and destroy all layers from the base canvas.

    Parameters

    • Optionaloptions: object = {}

    Returns Promise<EffectsCanvasGroup>

  • Test whether the point is inside darkness.

    Parameters

    Returns boolean

    Is inside darkness?

  • Test whether the point is inside light.

    Parameters

    • point: ElevatedPoint

      The point to test.

    • Optionaloptions: { condition?: (source: PointLightSource) => boolean } = {}
      • Optionalcondition?: (source: PointLightSource) => boolean

        Optional condition a source must satisfy in order to be tested.

    Returns boolean

    Is inside light?

  • Activate vision masking for visual effects

    Parameters

    • Optionalenabled: boolean = true

      Whether to enable or disable vision masking

    Returns void