Jack Blazes' Stuff
Home Origami Graphics Game Development Miscellaneous About
Resume

3D MPM Implementation
A college project - implementing the MPM method in 3D using Unity


The MPM method is a pretty effective way to simulate liquids or deformable solids. I adapted an existing 2D method to a 3D world for this demo. This was a college project, so time was limited, and I couldn't get every aspect perfect. For example, the parameters are not perfectly chosen - so there is infinite movement, which obviously shouldn't be possible. But there is also working interaction with a moveable object. You can see the github page for this project here.



Demo video



I based this project on a 2D implementation of the Multiple by nialltl. They also wrote a guide here. There's more work to do on this type of project, although my next demo would be implemented from scratch. I also always wanted to apply some rendering techniques to the sphere outputs to make it actually look like liquid. Nvidia has some resources on how you can do that - I spent a while trying to figure it out in Unity, but it had some build it limitations on what you can do with screen-space shaders and the depth buffer, so I couldn't get it working in the end. Next time, built from scratch, this should be possible.

MPM is an interesting method for simulation. It was made famous by its use in Frozen and the accompanying Disney paper, but has been advanced over the years. I've seen some impressive implementations of the method - for example, John Lin's single core liquid simulation, but I've yet to see it truly implemented within a game engine. It remains fairly expensive, with few gameplay benefits, so far at least. It has some promise, even if it only works as a visual effect in games. Water is ultimately hard to figure out as a gameplay mechanic, especially if it is truly realistic - but I have a few ideas for MPM-related gameplay mechanics.

This project wasn't my only project that used MPM, actually. I had another college project, that ultimately failed, with a goal of using another implementation of MPM (Taichi) to simulate how metal deforms when forged, which could allow people to plan deformation patterns for something like Damascus steel.




nialltl's implementation



Screenshot from the demo video