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.
  • Registers a newly created View with the renderer.

    Creates a ViewRenderState wrapper and assigns View.viewIndex.

    If there are already the maximum allowed number of views, returns an error result without adding the view. Any other operations on ViewManager for a view that was not successfully added will be quietly ignored, to reduce logging noise.

    Parameters

    • view: View

      The view to add.

    Returns SDKResult<any>

    SDKResult indicating success or failure.

    SDKInternalException If the given view id is already registered.

  • Unregisters a View and releases its associated rendering resources.

    If the View is not registered with the manager, this method will return ok:true with no value, and will not throw an error, since it's possible for the viewer to update views that have not been added to the renderer (eg. if they were filtered out due to max view limits).

    Parameters

    • view: View

      The view to remove.

    Returns SDKResult<any>

    SDKResult indicating success.

  • Applies updates for a View and renders it.

    This will activate the view if it is not currently active, upload any queued GPU changes, and issue a render.

    If the View is not registered with the manager, this method will return ok:true with no value, and will not throw an error, since it's possible for the viewer to update views that have not been added to the renderer (eg. if they were filtered out due to max view limits).

    Parameters

    • view: View

      The view to update and render.

    Returns SDKResult<any>

    SDKResult from the render call, or ok:true if the view is not registered, which is OK.

  • 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.