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.

Hook Events

Hierarchy

  • any
    • EffectsCanvasGroup

Properties

animateLightSources: boolean = true

Whether to currently animate light sources.

animateVisionSources: boolean = true

Whether to currently animate vision sources.

lightSources: any = ...

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

darknessSources: any = ...

A mapping of darkness 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

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

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

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

A layer which adds darkness effects to the scene.

Methods

  • Iterator for all light and darkness sources.

    Returns Generator<any, void, void>

    Yields

    foundry.canvas.sources.PointDarknessSource|foundry.canvas.sources.PointLightSource

  • Clear all effects containers and animated sources.

    Returns void

  • Parameters

    • options: any

    Returns Promise<void>

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

    Returns void

  • Re-initialize the shapes of all darkness sources in the Scene. This happens before initialization of light sources because darkness sources contribute additional edges which limit perception. Packages can use the "initializeDarknessSources" hook to programmatically add darkness sources.

    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

  • Refresh the active display of lighting.

    Returns void

  • Test whether the point is inside light.

    Parameters

    • point: Point

      The point.

    • elevation: number

      The elevation of the point.

    Returns boolean

    Is inside light?

  • Test whether the point is inside darkness.

    Parameters

    • point: Point

      The point.

    • elevation: number

      The elevation of the point.

    Returns boolean

    Is inside a darkness?

  • Get the darkness level at the given point.

    Parameters

    • point: Point

      The point.

    • elevation: number

      The elevation of the point.

    Returns number

    The darkness level.

  • Parameters

    • options: any

    Returns Promise<void>

  • Activate vision masking for visual effects

    Parameters

    • Optional enabled: boolean = true

      Whether to enable or disable vision masking

    Returns void

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

    Parameters

    • filterMode: string

      The filter mode to target.

    • Optional postProcessingModes: string[] = []

      The post-processing modes to apply to this filter.

    • Optional uniforms: any = {}

      The uniforms to update.

    Returns void

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

    Returns void

  • Activate light source animation for AmbientLight objects within this layer

    Returns void

  • Deactivate light source animation for AmbientLight objects within this layer

    Returns void

  • 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

  • Add a vision source to the effect layers.

    Parameters

    • source: any

      The vision source to add mesh layers

    Returns void

  • Add a light source or a darkness source to the effect layers

    Parameters

    • source: any

      The light or darkness source to add to the effect layers.

    Returns void

  • Private

    The ticker handler which manages animation delegation

    Parameters

    • dt: number

      Delta time

    Returns void