19 May 2026
Navier-Stokes fluid simulation explained with Godot game engine
When I first stumbled upon fluid simulations in game dev I was amazed on how good the effect could be. I really wanted to learn how this works, but learning materials on this topic are suprisingly sparse - and those which I found were pretty difficult to understand. Nonetheless, I decided to give it a try; and - while I’m at it - why not create a blog post out of it to hopefully make it easier for the next guy?
Before we begin, I want to stress a few points:
I’m not a mathematician. If you find errors in my explanations, please DM me on Bluesky or send an email and I’ll correct it
This implementation is for learning purposes only. For that reason it is implemented in a way that is not the best performance-wise. Calculations are made solely on the CPU. We introduce way too many variables. All of that to make it easier to read and learn, not necessarily to squeeze the most FPS.
Learning materials I used:
“Real-Time Fluid Dynamic for Games” by Jos Stam (PDF)
“Fluid Simulation for Dummies” by Mike Ash
You can find all of the code in this repository: github.com/rskupnik/godot-fluid-simulation-demo
... continue reading