Represents a single mesh within the WebGL renderer, managing its GPU tile assignment, transformation matrix, color, opacity, and various rendering states across multiple views.

  • RendererMesh is the GPU-side representation of a scene mesh, bridging scene/view state to GPU memory.
  • Each RendererMesh is owned by a RendererObject, which groups all meshes belonging to a single logical scene object.
  • RendererMesh instances are managed and batched by MeshBatchImpl, which organizes compatible meshes for efficient GPU upload and draw calls.
  • The MeshManager (or MeshBatchRegistry) coordinates the creation, update, and removal of RendererMesh instances, responding to scene/view changes and synchronizing with the GPU memory manager.
  • Maintains a reference to its assigned GPUTile, which defines the mesh's RTC (Relative To Center) coordinate system for high-precision rendering.
  • Tracks per-view state such as color, opacity, visibility, highlighting, selection, and x-ray status.
  • Handles updates to transformation matrices and notifies the GPU memory manager when changes require re-upload.
  • All tiling, RTC, and GPU memory logic is encapsulated by the memory management layer.

Constructors

Properties

gpuTile: GPUTile

Methods

  • Sets the color of the mesh, updating the color in all views that are not currently overridden by view-specific colorization. The incoming color is in normalised [0..1] range (the SceneMesh / SceneMaterial convention); the per-view attribute texture stores bytes 0..255, so we quantise here before forwarding.

    Parameters

    Returns void

  • Sets the colorization for a specific view. Called by RendererObject.setColorize.

    The incoming colorize value is already quantised to bytes 0..255 by RendererObject.setColorize (its caller). The restore branch (colorize === null) uploads sceneMesh.effectiveColor, which is in normalised [0..1] range and must be quantised here — otherwise the per-view attribute texture (Uint8 storage) truncates the fractional values to 0, painting the mesh black the moment the colorize tint is cleared.

    Parameters

    • viewIndex: number
    • colorize: Vec3

    Returns void