InternalCreates a GPUMemoryManager.
Shared renderer context used for WebGL access and config.
StaticitemEstimated per-item byte sizes managed by GPUMemoryManager.
Useful for debugging/telemetry and rough capacity planning.
Adds a SceneMesh to a batch and returns a GPUMemoryMeshHandle used for updates.
The handle contains:
gpuMemoryBatchIndex and meshIndex for addressing the meshnumIndices / numVertices counts for rendering/picking convenienceTarget batch index.
Mesh to add.
Notifies that a camera's view matrix was updated.
Forwards to GPUTileManager so per-tile per-view matrices can be recomputed/updated.
Creates and allocates a new GPU memory batch.
The created GPUMemoryBatch is appended to dataTextures.batches and DataTextures.onBatchCreated is dispatched.
SDKResult containing the new batch index, or ok:false if allocation fails.
Returns total GPU memory allocated by this manager in bytes.
Includes:
Returns draw parameters for a mesh in a given batch.
Intended to support WebGL drawArrays(first, count) style draws.
GPU batch index.
Mesh index within the batch.
Returns geometry for a given (batchIndex, geometryIndex) pair.
GPU batch index.
Geometry index within the batch.
Returns GPU memory usage in megabytes, derived from allocated/used byte totals.
Returns a mesh for a given (batchIndex, meshIndex) pair.
GPU batch index.
Mesh index within the batch.
Returns the current number of allocated tiles.
Returns total GPU memory currently used by this manager in bytes.
Includes:
Returns whether a batch has sufficient remaining space to add the given mesh.
Target batch index.
Mesh to test.
Allocates GPU memory and initializes tile-related data textures for this manager.
Creates:
viewTileCameraMatrixTexture[0..3] mapping tileIndex -> camera view matrix per viewviewTilePickMatrixTexture[0..3] mapping tileIndex -> pick matrix per viewSDKResult that is ok:true when initialization succeeds, or ok:false
when texture allocation fails (typically due to GPU memory limits).
Moves a tile (if required) so it contains the given world-space position.
The same tile if no move was needed, otherwise a different tile. When a different tile is returned, the old tile is released back to GPUTileManager.
Releases a tile back to the tile manager.
A tile is destroyed/recycled once it has been released as many times as it was acquired.
The tile to release.
Removes a mesh from GPU memory.
Mesh handle returned by addMesh.
Sets batch-wide (all-view) attributes for a mesh.
Mesh handle returned by addMesh.
Attribute parameters.
OptionaltileIndex?: numberOptional explicit tile index containing the mesh. This can change over time as the mesh moves between tiles.
Sets the modeling transform matrix for a mesh.
The modeling transform is relative to the center of the mesh's current tile.
Mesh handle returned by addMesh.
Model matrix.
Sets the render pass state for a mesh within a view.
Mesh handle returned by addMesh.
Target view index.
Render pass value to assign.
Sets per-view attributes for a mesh.
Mesh handle returned by addMesh.
Target view index.
Per-view attributes.
Optionalclippable?: booleanWhether the mesh participates in clipping.
Optionalcolor?: Vec3RGB color encoded as bytes 0..255 (packed on upload).
Optionalopacity?: numberOpacity in range 0..1.
Optionalpickable?: booleanWhether the mesh can be picked.
Sets whether a mesh is visible in a given view.
Mesh handle returned by addMesh.
Target view index.
Visibility flag.
Uploads all pending CPU-side changes to GPU textures/buffers.
This should be called once per frame (or tick) before rendering, after any state changes have been queued by higher-level managers.
Owns GPU-resident, dynamically editable storage for tiles, geometry, and mesh attributes.
Owned by a ViewManager, used by MeshManager, RenderManager, and PickManager.
GPUMemoryManagerimplements a data-texture + batch based memory system to support rendering and picking for large scenes with frequent updates.It is responsible for:
Tiled Coordinate System, RTC (Relative To Center), and GPU Matrix Textures
Large-scale 3D scenes require high-precision rendering, which is achieved by partitioning world space into "tiles". Each tile defines a local coordinate system centered at a specific world position, allowing geometry within the tile to be transformed relative to its center (RTC: Relative To Center). This approach minimizes floating-point precision errors when rendering large or distant objects.
Key Components
GPUTile:
GPUTileManager:
MatrixTexture:
DataTextures.viewTileCameraMatrixTexture:
DataTextures.viewTilePickMatrixTexture:
Matrix Conversion and GPU Upload
Shader Usage
Workflow Summary
Remarks