Streaming Audio and Physics Metadata with glTF
Streaming external audio and physics metadata alongside glTF enables rich, interactive 3D environments without inflating initial model download sizes. By decoupling secondary data streams from the primary geometry and texture payloads, applications can dynamically load spatial sound, collision hulls, and rigid body dynamics. This article outlines the primary architectural patterns and standard extensions used to synchronize and stream audio and physics alongside glTF assets.
Node-Based Metadata Referencing
The standard glTF specification allows arbitrary data to be attached
to nodes via the extras field or custom vendor extensions.
Instead of embedding large audio buffers or complex physics definition
tables directly into the glTF JSON or .glb binary,
developers insert metadata references—such as streaming URLs, asset IDs,
or WebRTC channel identifiers—directly onto specific transform
nodes.
When the runtime parses the scene graph, it extracts these references and binds them to external engines:
- Audio: A node's world transform matrix is linked to
an audio listener or a 3D spatialized panner node (such as the Web Audio
API's
PannerNode), streaming the actual audio track via HLS, DASH, or an audio element. - Physics: A node points to a remote physics collider definition or collision geometry streamed over a separate network request, instantiating the collider within physics engines like PhysX, Havok, or Rapier.
Khronos and Community Extensions
Standardized glTF extensions provide formal schemas for binding external data streams without breaking interoperability:
- KHR_audio (and community variants like OMI_audio): These extensions define audio emitters and sound sources linked to glTF nodes. Instead of embedding base64-encoded audio clips, the emitter references external URI streams. The client initializes the audio player upon asset loading, streaming positional audio that moves synchronously with the host node's transforms.
- OMI_physics / KHR_physics_rigid_bodies: The Khronos
Group and Open Metaverse Interoperability (OMI) group have standardized
physics metadata schemas. These extensions define rigid body types
(static, kinematic, dynamic), mass, velocity, friction, and collision
shapes. High-fidelity collision meshes can be designated via separate
buffer views or external
.binURLs loaded asynchronously, keeping the visual mesh independent of the physical representation.
Sidecar Data Streams and Network Multiplexing
For live or multi-user applications, streaming metadata in real time requires dedicated network channels rather than static HTTP requests. The visual model remains a static glTF cache, while dynamic metadata streams over parallel protocols:
- WebRTC DataChannels and WebSockets: Low-latency protocols stream high-frequency physics updates (linear velocity, angular velocity, and joint constraints) and dynamic audio states. The glTF node IDs serve as unique keys to map inbound streaming packets to the visual representation in the client-side scene graph.
- glTF Buffers with External URIs: glTF supports
declaring
bufferswith external URIs instead of embedding data directly. By pointing a buffer to a chunked transfer or custom network stream, runtimes can progressively fetch physics point clouds or temporal animation caches while the scene renders.
Synchronization Strategies
Synchronizing decoupled streams requires consistent clock alignment across the rendering, audio, and physics pipelines:
- Timestamped Packets: Physics and audio metadata packets carry millisecond-accurate timestamps matching the client’s animation timeline, preventing visual-physical desynchronization during frame drops.
- Transform Interpolation: Because network physics streams often run at different tick rates (e.g., 30Hz or 60Hz) than the rendering display rate (e.g., 90Hz or 120Hz), the client-side engine uses linear or spherical linear interpolation (SLERP) to smooth the position and orientation of nodes between physics updates.
- Audio Doppler and Velocity Binding: Node velocity data calculated from the physics stream is fed into the spatial audio engine to dynamically compute Doppler shifts, ensuring acoustic behavior accurately reflects dynamic physical movements.