Skip to content

amaury-aubel/PBD-2d-sim

Repository files navigation

PBD-2d-sim

Position-Based Dynamics 2d simulation

A small personal project in C++ I did to play with the Position-Based Dynamics (PBD) method for simulating particles with friction (e.g. sand).

Quick demoAnother quick demo

It relies on Magnum, a cross-platform graphics library, and Intel's TBB for multi-threading. Except for the physics part, a good chunk of the code is derived from the APIC Fluid simulation from the Magnum example gallery.

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

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.

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 simulated an avalanche using 120 million simulated particles.

Having fun with the washing machine:

Washer