This is an Unity implementation of MPM(Material Point Method). There is no straight forward implantation of MPM in Unity so far. Other implementations usually skip/optimize steps of original mpm too much, which makes them difficult to understand at first time. They are also coded in c++/python. nialltl's implementation is a very good MPM tutorial, but he only implements MLSMPM without snow.
This repository starts from APIC framework, then try to follow original mpm/mpm course and match each step in the course. Then move to MLSMPM. It also contains 3D implementation on CPU/GPU.
It is under development and needs optimization and parameter tuning.
Screenshots are taken on Surface book 2 with GTX1060
- APIC: The Affine Particle-In-Cell Method
- MPM: The material point method for simulating continuum materials
- MLSMPM: A Moving Least Squares Material Point Method with Displacement Discontinuity and Two-Way Rigid Body Coupling
(First play may be lagging in fps due to large gif downloading)
In APIC folder, there are CPU/GPU 2D/3D implementations of APIC framework(no fluid).
- White squares are particles.
- Red spheres are cell mass/velocity that transferred from particles.
In MPM folder, there are CPU/GPU 2D/3D implementations of MPM. It matches every step of original mpm course/paper. So it may be slow for real time.
MPMCPU implements "weakly" compressed fluid, snow and elastic material.
MPMGPU speeds up a bit.
Implementation of A Moving Least Squares Material Point Method with Displacement Discontinuity and Two-Way Rigid Body Coupling
- Elastic
- Snow
- Fluid