https://github.com/dimforge/slosh
Cross-platform MPM physics simulation in Rust and Slang
https://github.com/dimforge/slosh
Last synced: 5 months ago
JSON representation
Cross-platform MPM physics simulation in Rust and Slang
- Host: GitHub
- URL: https://github.com/dimforge/slosh
- Owner: dimforge
- License: apache-2.0
- Created: 2025-08-16T15:03:29.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-09-20T14:59:52.000Z (6 months ago)
- Last Synced: 2025-10-03T06:47:35.842Z (5 months ago)
- Language: Rust
- Size: 1.48 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Slosh: cross-platform MPM GPU physics simulation
## Running the examples
1. Download the Slang compiler libraries for your platform: https://github.com/shader-slang/slang/releases/tag/v2025.16
2. Unzip the downloaded directory, and use its path as value to the `SLANG_DIR` environment variable: `SLANG_DIR=/path/to/slang`.
Note that the variable must point to the root of the slang installation (i.e. the directory that contains `bin` and `lib`).
3. For the 2D examples, run `cargo run --release --example testbed2`
4. For the 3D examples, run `cargo run --release --example testbed3`
## Notable MPM use-cases
This gives some insights of some interesting usages of MPM (the Material Point Method) for deformable physics
simulation. Note that it doesn’t imply that **slosh** currently implements these models:
- Animation: one very well-known usage of MPM is
[snow simulation](https://www.disneyanimation.com/publications/a-material-point-method-for-snow-simulation/) by Pixar.
- Engineering: blast movement simulation ([patented](https://patents.google.com/patent/WO2025136223A1)).