Top-level, internal rendering and pipeline manager within a WebGLRenderer.

  • ViewManager is owned by a single WebGLRenderer instance.
  • It manages all Views for a given Viewer.
  • Acts as the central coordinator for per-View state, rendering, and GPU resource management.
  • Owns and initializes the shared WebGL RenderContext and its underlying canvas element.
  • Instantiates and wires together the core pipeline managers:
    • GPUMemoryManager: Manages GPU-side storage, data textures, and memory uploads for all views.
    • MeshManager: Bridges scene/view state changes (transforms, colors, visibility, etc.) into GPU-ready render state for all views.
    • RenderManager: Executes draw passes for the currently active view, managing the render pipeline.
    • PickManager: Handles GPU-backed picking resources and queries for all views.
  • Tracks and manages ViewRenderState instances for each View, synchronizing per-view state and resources.
  • Handles view activation, moving/resizing the shared WebGL canvas to match the active view element, and snapshotting the previous view as needed.
  • Exposes the set of GPU-backed data textures (via dataTextures) for diagnostics.
  • The WebGLRenderer owns a single ViewManager.
  • The ViewManager manages all Views for the associated Viewer, supporting multi-view rendering.
  • It owns and coordinates all pipeline managers, ensuring that scene and view changes are efficiently reflected in GPU state and draw calls.
  • All per-view rendering, picking, and GPU resource management flows through the ViewManager and its managers.
  1. Constructed by WebGLRenderer.
  2. Initialized via init with a Viewer and memory configs.
  3. For each view added/removed: viewCreated / viewDestroyed.
  4. For each view update: viewUpdated.
  5. On shutdown: destroy.

Constructors

Properties

_activeView: ViewRenderState

Currently active renderer view.

The WebGL canvas is positioned/sized to this view’s HTML element.

_gpuMemoryManager: GPUMemoryManager

Owns GPU-side geometry/mesh buffers and data-texture uploads.

_meshManager: MeshManager

Translates scene/view changes into GPU uploads (transforms, colors, flags, etc.).

_pickManager: PickManager

Manages GPU picking resources and queries.

_rendererViews: Record<string, ViewRenderState> = {}

Map of view id -> renderer view wrapper.

_renderManager: RenderManager

Executes draw passes for the active view.

dataTextures: DataTextures = undefined

GPU-backed textures created/owned by GPUMemoryManager. Exposed for diagnostics. Available after init succeeds; undefined after destroy.

shaderInspector: ShaderInspector

Exposes shader source code for all techniques used by the renderer. Exposed for diagnostics. Available after init succeeds; undefined after destroy.

Accessors

Methods

  • Destroys all renderer-managed resources and detaches from the Viewer.

    After calling this, the instance must not be used unless init is called again.

    Returns void

    • Destroys all ViewRenderStates, then tears down managers in reverse dependency order.
    • Sets internal references to undefined to help catch use-after-destroy in development.
  • Initializes the manager and all underlying pipeline components for a given Viewer.

    A separate init method is used so initialization can fail gracefully via SDKResult rather than throwing.

    Parameters

    Returns SDKResult<void>

    SDKResult that is ok: true when initialization succeeds, or ok: false with an SDKErrorType and message when initialization fails.

    • Enforces a current maximum of 4 views.
    • Creates ViewRenderState wrappers for any views already present on the viewer.
  • Reinitializes GPU and render state after a WebGL context restoration event.

    Call this after the underlying WebGL context has been restored to recreate GPU resources for memory, rendering, and picking.

    Returns SDKResult<void>

    SDKInternalException If the manager has not been initialized.