Skip to content

amaury-aubel/PBD-2d-sim-gpu

Repository files navigation

PBD-2d-sim-gpu

Position-Based Dynamics 2d simulation on the GPU.

Click on this link to play with it! Should work on most Android devices & PCs, not so on Apple devices unfortunately (mac, ipad, etc.)

This is a port of the C++ Position-Based Dynamics (PBD) 2d engine I wrote a little while ago to Javascript/WebGL2. While the C++ version was multi-threaded, this one can run on the GPU for practically all steps (except neighborhood search).

Quick demoAnother quick demo

While the hybrid Material Point Method (MPM) is gaining popularity for simulating particulate effects such as snow or sand in the Computer Graphics community, PBD remains an amazingly fast simulation tool that offers a simple trade off between precision and speed by controlling the number of constraint iterations.

An excellent introduction to PBD is available in this paper: http://mmacklin.com/EG2015PBD.pdf.

I have used extensively Houdini's implementation of PBD on the movie How to Train your Dragon: the Hidden World. See some sand examples here. Here is another example from the movie Abominable where I animated an avalanche using 120 million simulated particles.

Having fun with the washing machine:

Washer