2D Fluid Sim

click / tap and drag

R.L.Shaffer © 2025

click / tap and drag

Controls

About

My first stab at an Eulerian fluid simulation.

The sim uses a collocated grid and a Jacobi iterative solver. Based on the procedure outlined by Mark J. Harris in Nvidia's GPU Gems article, "Fast Fluid Dynamics Simulation on the GPU", and converted to WebGL using three.js with multiple render targets and custom fragment shaders.

I make no claim of physical accuracy to real fluids. The solver uses a basic method, and accuracy was also compromised for performance. Future versions of this could involve an improved solver as well as adding physical effects like buoyancy, free-surface condition, etc...

Loading