https://github.com/activexdiamond/stable-fluid-dynamics
A Lua/Love2D physics simulation of stable fluids implenting Jos Stam's paper on the subject.
https://github.com/activexdiamond/stable-fluid-dynamics
fluid-dynamics fluid-simulations game-dev game-developement gamedev library love2d lua physics physics-simulator physics-tool simulation-framework simulator tool
Last synced: about 1 month ago
JSON representation
A Lua/Love2D physics simulation of stable fluids implenting Jos Stam's paper on the subject.
- Host: GitHub
- URL: https://github.com/activexdiamond/stable-fluid-dynamics
- Owner: ActivexDiamond
- License: mit
- Created: 2022-06-01T13:44:14.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-04T00:37:30.000Z (almost 4 years ago)
- Last Synced: 2025-12-26T22:49:01.786Z (5 months ago)
- Topics: fluid-dynamics, fluid-simulations, game-dev, game-developement, gamedev, library, love2d, lua, physics, physics-simulator, physics-tool, simulation-framework, simulator, tool
- Language: Lua
- Homepage:
- Size: 22.2 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stable Fluid Dynamics Library
A Lua/Love2D physics simulation of stable fluids implenting Jos Stam's paper on the subject.
Can be run as a stand-alone sandbox to explore the concept or used as a Lua library to implement this behavior into your own game or project.
## Demo


## Controls
- LMB -> Add static density source.
- RMB -> Add static density source with a random velocity.
- LMB + Shift -> Remove density.
- RMB + Shift -> Remove velocity.
Note: Currently, once a source is added there is no way to remove or modify it. (WIP)
## References
A pure-Lua implementation of Jos Stam's 2003 paper ["Real-Time Fluid Dynamics for Games"](https://www.dgp.toronto.edu/public_user/stam/reality/Research/pdf/GDC03.pdf)
*The link above directs to a freely accessible online pdf of his paper.*
Special thanks to Gonkee's ([YouTube channel](https://www.youtube.com/channel/UCG2IoSJBUhrGL8fb5stMCWw)) video --- ["But How Do Fluid Simulations Work?"](https://www.youtube.com/watch?v=qsYE1wMEMPA) --- for introducing me to this concept and paper.