Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Anyone have any good examples, tutorials, or snippets to share that preferably in C# or C/C++?

share|improve this question

closed as too broad by Anko, Josh Petrie Dec 14 '15 at 16:39

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 9 down vote accepted

PixelJunk shooter from Q-Games has nice set of fluids. There is a GDC paper they have published here: (PDF!)

Jos Stam from Alias Maya fame (now Autodesk) wrote paper on real time fluids in games here: (PDF!)

And he wrote a simple FFT fluid solver here: (PDF!) where he included source in that PDF at the end.

share|improve this answer

alt text

  • Practical Fluid Mechanics
    • Very detailed explanation with C++ code and pre-compiled binary. You can interact with the demo, like creating new smoke and stirring the smoke with your mouse. The image is a capture of the demo. Lists several on-line references at the end, as well.
  • Stable Fluids [PDF]
    • I think the author, Jos Stam, is the expert when it comes to fluid dynamics. 75 page summary of his research.
  • Chapter 38. Fast Fluid Dynamics Simulation on the GPU
    • More technical and math-heavy then the Cowboy Programming Practical Fluid Mechanics. Also lists several off-line resources at the end.
  • A Fire and Smoke Simulation for Mobile Game [PDF]
    • The weakest resource of the bunch, but I still found it worth bookmarking...
share|improve this answer

Here's a fairly primitive write up about using cellular automata for simulating fluids:

In certain situations such a simple approach can be appropriate (Dwarf Fortress uses a similar approach to simulate liquid flow; also - the powder game). Also, this approach is pretty easy to grasp/get up and running fast.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.