Dozens of rigid bodies tumbling and stacking inside a WebGPU canvas, settling into stable piles as the AVBD solver resolves contacts in real time.
Rigid bodies tumbling in a browser tab is not new. Rigid bodies tumbling in a browser tab because your GPU is solving a paper from SIGGRAPH 2025 in parallel, color by color, is a little newer. Jure Triglav's webphysics is a WebGPU implementation of Augmented Vertex Block Descent (Giles et al., 2025), and the demo is exactly the kind of thing you want to poke at with a stick: stacks that settle instead of jittering themselves to death, piles that feel like they have opinions about mass. The reference demo from the Utah graphics lab that introduced AVBD is CPU-serial. This one isn't.
What makes it worth reading the source is how faithfully the pipeline mirrors Algorithm 1 of the paper while living entirely on the GPU. LBVH broad phase, narrow-phase manifolds with warm-started contact state, greedy graph coloring so bodies of the same color solve in parallel during the primal step, then dual and stiffness updates in the augmented-Lagrangian style, then velocity reconstruction. Jure is candid that it's an early proof of concept (Chrome only, in-place colored solves instead of the paper's double-buffered variant for rare same-color conflicts), and the code is laid out so you can walk from PhysicsEngine.ts outward and actually follow what each stage is doing.
Clone the repo, open src/physics/gpu/avbdState.ts, and trace a single substep from inertial init through the colored primal sweep. If you want gentler onboarding to how Jure thinks about GPU graphics on the web, his surfel-based global illumination writeup breaks a similarly ambitious project into small interactive pieces. The HN thread is also worth a skim, mostly for Jure casually mentioning he has an Offset Geometric Contact implementation sitting around too, as one does.
- Live Demo: https://jure.github.io/webphysics
- Source Code: https://github.com/jure/webphysics
- Author: Jure Triglav (GitHub, Bluesky)