WebPhysics: Experimental WebGPU Physics Prototype
AI Summary
WebPhysics is an innovative prototype leveraging WebGPU to explore advanced physics simulations, specifically focusing on rigid-body and soft-body dynamics through an AVBD-style solver. This project is a testament to my passion for cutting-edge web graphics and open-source experimentation. The setup is straightforward with npm commands, but note that it is not yet a plug-and-play module and currently supports only Chrome.
## AVBD Pipeline
The AVBD pipeline forms the backbone of this project, mirroring the structure of Algorithm 1 from the AVBD paper by Giles et al. (2025). It begins with collision detection from the current state, followed by broad phase candidate generation using an LBVH. The narrow phase then constructs manifolds for contact generation, preserving states for warm-starting and friction handling.
## Constraint and Coloring
The per-body constraint list is constructed by iterating over each force affecting the body, gathering contacts, joints, and springs. Greedy coloring is employed to allow parallel processing of bodies during the primal step. The inertial target and primal state are initialized, with dual and stiffness variables warm-started using specific scaling factors.
## Iterative Solving and Updates
The main AVBD iteration involves a colored primal body solve, where inertial and constraint contributions are accumulated and applied. Dual variables and stiffness values are updated in parallel, adhering to augmented-Lagrangian rules. Velocities are finalized from the updated state, completing the AVBD position solve.
## Implementation Notes
This initial release closely follows the AVBD paper's pipeline, though it uses an in-place colored body solve rather than the paper's double-buffered position updates for same-color conflicts. Future updates will aim to enhance stability, performance, and usability.
Key Concepts
The Augmented Vertex Block Descent (AVBD) solver is a computational method used to solve physics simulations involving rigid-body and soft-body dynamics. It optimizes the simulation process by iteratively updating positions and velocities of objects based on constraints and forces.
WebGPU is a modern graphics API designed to provide high-performance graphics and computation capabilities in web applications. It allows developers to harness the power of the GPU for rendering and parallel computation tasks directly in the browser.
Category
TechnologyOriginal source
https://github.com/jure/webphysicsMore on Discover
Summarized by Mente
Save any article, video, or tweet. AI summarizes it, finds connections, and creates your to-do list.
Start free, no credit card