This repository simulates and renders fluid particles in two dimensions.
Click HERE to run the simulation in a browser.
The simulation uses MLS-MPM algorithm (Moving Least Squares Material Point Method).
I implemented this by following nialltl's article on MLS-MPM and matching example code.
Library ebiten is used to render the output to a window and allows seamless compilation to WASM.
The simulation is single threaded but still renders the examples in real time on a fast CPU.
Running this in WASM in the browser is about 10x slower than native speed. WebGL support may help when it finally arrives...
Build and run the cmd/sim package to run simulation at native speed.