Cloth Simulation with XBPD
An independent developer built a deterministic, GPU-accelerated cloth simulation system using Extended Position-Based Dynamics (XPBD) inside a custom 3D engine written in C3.
summary is enough The post offers cool interactive WebGPU demos and high-level architectural notes, but omits deep mathematical explanations of the XPBD implementation details.
summary
A developer built a deterministic cloth simulation system using Extended Position-Based Dynamics (XPBD) within a custom 3D engine written in C3 called drie. The system runs via compute shaders and supports crease-preservation, two-way object collision, and aerodynamic drag. The author outlines key engineering hurdles like self-tangling and tethers slipping through geometry, noting ongoing experiments with Signed Distance Fields. Interactive WebGPU browser demos accompany the post, showcasing the cloth alongside volumetric fog and dynamic lighting.
key points
- The cloth simulation uses Extended Position-Based Dynamics (XPBD) executed in compute shaders to ensure deterministic and stutter-free execution.
- Self-tangling and merging issues are mitigated using spatial hashing and crease-preserving bend models.
- The 3D engine is written entirely in C3 and compiled to the web via WebGPU and sokol_gfx.
who should read it
Game developers and graphics programmers interested in real-time physics simulation and custom engine architecture.
discussion positive
consensus
Commenters generally praise the visual quality of the WebGPU demos and discuss the mechanics of the volumetric lighting and shadow mapping used in the scene.
pushback
A few users point out that the post acts more as a showcase than a tutorial, lacking deep algorithmic breakdowns of how the XPBD constraints are solved.
Thank you :)
The light uses a froxel volumetric fog [1] implementation. The flares are bloom + a rendering from the camera POV, the lens reflection reprojected a few times.
[1] https://www.mattiasstrand.com/posts/volumetric-fog/
The author shares specific implementation details regarding the froxel volumetric fog and lens flare bloom effects used in the handkerchief demo.
Generated by an LLM from the article and thread. Check the sources before relying on it.