The depth mask which contains a mapping of elevation. Needed to know if we must render objects according to depth. Red channel: Lighting occlusion (top). Green channel: Lighting occlusion (bottom). Blue channel: Weather occlusion.

Hierarchy (View Summary)

Properties

_elevationDirty: boolean = false

Update the elevation-to-depth mapping?

autoRender: boolean = true

If true, the Container is rendered every frame. If false, the Container is rendered only if CachedContainer#renderDirty is true.

clearColor: number[] = ...
displayed: boolean = false

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

renderDirty: boolean = true

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

roofs: Container<DisplayObject>

Container in which roofs are rendered with depth data.

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

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

textureConfiguration: {
    format: FORMATS;
    multisample: MSAA_QUALITY;
    scaleMode: SCALE_MODES;
} = ...

Accessors

  • set alphaMode(mode: ALPHA_MODES): void

    Set the alpha mode of the cached container render texture.

    Parameters

    • mode: ALPHA_MODES

    Returns void

  • get renderTexture(): RenderTexture

    The primary render texture bound to this cached container.

    Returns RenderTexture

  • get sprite(): SpriteMesh | Sprite

    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 SpriteMesh | Sprite

Methods

  • Internal

    Update the elevation-to-depth mapping. Needs to be called after the children have been sorted and the canvas transform phase.

    Returns void

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

    Parameters

    • Optionaloptions: { clearColor?: number[]; renderFunction?: Function } = {}

      Optional parameters.

      • OptionalclearColor?: number[]

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

      • OptionalrenderFunction?: Function

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

    Returns RenderTexture

    A reference to the created render texture.

  • Parameters

    • options: any

    Returns void

  • Map an elevation to a value in the range [0, 1] with 8-bit precision. The depth-rendered object are rendered 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

  • Remove a previously created render texture.

    Parameters

    • renderTexture: RenderTexture

      The render texture to remove.

    • Optionaldestroy: boolean = true

      Should the render texture be destroyed?

    Returns void

  • Parameters

    • renderer: any

    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.

    • OptionalclearColor: number[]

      A custom clear color.

    Returns void

  • Protected

    Custom rendering for secondary render textures

    Parameters

    • renderer: Renderer

      The active canvas renderer.

    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