How Cesium Streams Massive 3D Data with glTF Tiling

Rendering terabyte-scale city models in a web browser requires an architecture that avoids loading entire datasets into memory at once. Cesium achieves this through 3D Tiles, an open spatial data structure that hierarchically partitions massive geospatial datasets into streamable, GPU-ready glTF (Graphics Language Transmission Format) assets. By combining spatial indexing, hierarchical levels of detail (HLOD), and dynamic runtime evaluation, Cesium streams only the necessary geometry and texture data required for any given camera view.

Spatial Partitioning and the 3D Tiles Hierarchy

Cesium does not treat a city model as a single monolithic file. Instead, the dataset is indexed into a tree-based spatial data structure, such as an octree, quadtree, or k-d tree. The geographic volume of the entire dataset is wrapped in a root bounding volume (a box, sphere, or oriented bounding box).

This root volume is recursively divided into smaller child bounding volumes covering progressively smaller geographic footprints. Each node in this hierarchical tree references a 3D payload containing the visual data for that specific bounding region.

glTF as the Core Data Payload

In modern 3D Tiles (3D Tiles 1.1), the primary payload for each tile is standard glTF 2.0. glTF is specifically designed for the runtime transmission of 3D scenes. It packages geometry, materials, and textures directly into binary buffers (.bin) and compressed formats like Draco or meshopt for geometry, and KTX2 with Basis Universal for textures.

Because glTF mirrors the memory layouts required by graphics APIs like WebGL and WebGPU, Cesium can upload the incoming tile payloads directly to the GPU without needing CPU-intensive parsing or mesh restructuring. In legacy implementations, this was achieved using the Batched 3D Model (.b3dm) container, which wrapped a glTF model alongside custom per-feature metadata tables.

Hierarchical Level of Detail (HLOD)

The core mechanism allowing Cesium to handle terabytes of data is Hierarchical Level of Detail (HLOD). In this structure:

  • Root and upper-level nodes contain highly simplified, decimated versions of the geometry representing large geographical expanses.
  • Child and leaf nodes contain high-fidelity, photorealistic geometry representing individual buildings, city blocks, or street-level features.

Each tile defines a metric called geometricError, which quantifies how much the tile's simplified model deviates from the real-world geometry it represents.

Screen Space Error and Dynamic Streaming

During every frame of execution, Cesium calculates the Screen Space Error (SSE) for tiles intersecting the camera view. The SSE formula factors in the tile’s predefined geometricError, the distance from the camera to the tile, and the display resolution:

\[\text{SSE} = \frac{\text{geometricError} \times \text{screenHeight}}{2 \times \text{distance} \times \tan(\text{FOV} / 2)}\]

If the calculated SSE exceeds a configurable threshold (typically 16 pixels), the current tile's visual representation is considered too coarse, and Cesium requests its children from the server. Once the child tiles finish downloading, Cesium swaps out the parent mesh for the higher-resolution children. If the camera pulls away, the process reverses, swapping detailed children for coarser parent tiles.

Culling and Memory Management

To maintain steady 60 FPS performance without exceeding browser memory limits, Cesium applies several optimizations:

  • Frustum Culling: Bounding volumes falling outside the camera's view frustum are ignored, preventing requests for unseen glTF chunks.
  • Horizon and Occlusion Culling: Tiles hidden behind the curvature of the Earth or obscured by foreground geometry are omitted from the rendering queue.
  • Cache Eviction: Cesium maintains a strict memory budget (e.g., 512 MB to 1 GB of RAM). Tiles that fall out of the active view or are replaced by higher-level parents are tagged for garbage collection and purged from GPU and system memory using a Least Recently Used (LRU) eviction strategy.

Through spatial indexing, glTF binary efficiency, and real-time SSE evaluation, Cesium visualizes terabyte-scale urban environments by rendering only the visible, resolution-appropriate fraction of the data at any given moment.