The occlusion mask which contains radial occlusion and vision occlusion from tokens. Red channel: Fade occlusion. Green channel: Radial occlusion. Blue channel: Vision occlusion.

Hierarchy (view full)

Properties

tokens: LegacyGraphics

Graphics in which token radial and vision occlusion shapes are drawn.

clearColor: number[] = ...
autoRender: boolean = false
renderDirty: boolean = true

Does the Container need to be rendered? Set to false after the Container is rendered.

displayed: boolean = false

Should our Container also be displayed on screen, in addition to being drawn to the cached RenderTexture?

_renderPaths: Map<RenderTexture, {
    renderFunction: Function;
    clearColor: number[];
}> = ...

A map of render textures, linked to their render function and an optional RGBA clear color.

Type declaration

  • renderFunction: Function
  • clearColor: number[]
#tokens: Token[]

The occludable tokens.

#vision: boolean = false
#elevations: Float64Array = ...

The elevations of the elevation-to-depth mapping. Supported are up to 255 unique elevations.

textureConfiguration: {
    scaleMode: any;
    format: any;
    multisample: any;
} = ...

Type declaration

  • scaleMode: any
  • format: any
  • multisample: any

Accessors

  • get vision(): boolean
  • Is vision occlusion active?

    Returns boolean

  • set alphaMode(mode): void
  • Set the alpha mode of the cached container render texture.

    Parameters

    • mode: ALPHA_MODES

    Returns void

  • get sprite(): any
  • A PIXI.Sprite or SpriteMesh which is bound to this CachedContainer. The RenderTexture from this Container is associated with the Sprite which is automatically rendered.

    Returns any

  • get renderTexture(): RenderTexture
  • The primary render texture bound to this cached container.

    Returns RenderTexture

Methods

  • Map an elevation to a value in the range [0, 1] with 8-bit precision. The radial and vision shapes are drawn with these values into the render texture.

    Parameters

    • elevation: number

      The elevation in distance units

    Returns number

    The value for this elevation in the range [0, 1] with 8-bit precision

  • Update the set of occludable Tokens, redraw the occlusion mask, and update the occluded state of all occludable objects.

    Returns void

  • Internal

    Draw occlusion shapes to the occlusion mask. Fade occlusion draws to the red channel with varying intensity from [0, 1] based on elevation. Radial occlusion draws to the green channel with varying intensity from [0, 1] based on elevation. Vision occlusion draws to the blue channel with varying intensity from [0, 1] based on elevation.

    Returns void

  • Internal

    Update the current occlusion status of all Tile objects.

    Returns void

  • Create a render texture, provide a render method and an optional clear color.

    Parameters

    • Optional options: {
          renderFunction: Function;
          clearColor: number[];
      } = {}

      Optional parameters.

      • renderFunction: Function

        Render function that will be called to render into the RT.

      • clearColor: number[]

        An optional clear color to clear the RT before rendering into it.

    Returns RenderTexture

    A reference to the created render texture.

  • Remove a previously created render texture.

    Parameters

    • renderTexture: RenderTexture

      The render texture to remove.

    • Optional destroy: boolean = true

      Should the render texture be destroyed?

    Returns void

  • Parameters

    • renderer: any

    Returns void

    Inherit Doc

  • Protected

    Determine the set of objects which should be currently occluded by a Token.

    Parameters

    • tokens: Token[]

      The set of currently controlled Token objects

    Returns Set<((DisplayObject) => any)>

    The PCO objects which should be currently occluded

  • Protected

    Custom rendering for secondary render textures

    Parameters

    • renderer: Renderer

      The active canvas renderer.

    Returns void

  • Protected

    Bind a render texture to this renderer. Must be called after bindPrimaryBuffer and before bindInitialBuffer.

    Parameters

    • renderer: Renderer

      The active canvas renderer.

    • tex: RenderTexture

      The texture to bind.

    • Optional clearColor: number[]

      A custom clear color.

    Returns void

  • Initialize the depth mask with the roofs container and token graphics.

    Returns void

  • Resize a render texture passed as a parameter with the renderer.

    Parameters

    • renderer: Renderer

      The active canvas renderer.

    • rt: RenderTexture

      The render texture to resize.

    Returns void