A WebGPU Implementation of Augmented Vertex Block Descent
Jure Triglav unveils "webphysics," an experimental WebGPU physics engine leveraging the cutting-edge Augmented Vertex Block Descent (AVBD) solver, a technique from a 2025 research paper. This ambitious project aims to push the boundaries of real-time rigid-body and soft-body simulations directly within the browser. It appeals to Hacker News' audience through its blend of novel academic research, experimental web technology, and a detailed, open-source implementation.
The Lowdown
Jure Triglav's "webphysics" project introduces an experimental, open-source physics engine designed for the web, utilizing the nascent WebGPU API. This prototype focuses on rigid-body and soft-body simulations, implementing a sophisticated solver method known as Augmented Vertex Block Descent (AVBD), which is based on a research paper by Giles et al. slated for 2025. The project serves as a practical demonstration of advanced physics concepts within a web-native, GPU-accelerated environment.
- The engine is an initial proof of concept, currently limited to Chrome browsers, and is not yet a plug-and-play module.
- Its core pipeline closely follows Algorithm 1 from the AVBD paper, encompassing several stages for physics simulation.
- Key steps include collision detection from the current state, broad phase candidate generation using an LBVH, and narrow phase manifold generation for contact points.
- It constructs per-body constraint lists and employs a greedy coloring algorithm to enable parallel processing of bodies during the primal solve step.
- The pipeline involves inertial target and primal state initialization, followed by the main AVBD iteration which includes colored primal body solves and dual/stiffness updates.
- Finally, velocities are reconstructed, and optional post-processing like sleep and diagnostics can be applied.
- The current implementation matches the paper's broad pipeline but notably differs in its in-place colored body solve approach compared to the paper's double-buffered position updates for certain conflict scenarios.
This project provides a valuable open-source example of how cutting-edge physics research can be translated into a functional, GPU-accelerated web application, offering a glimpse into the future of high-performance interactive experiences on the web.