How to make a Realtime 3D Eulerian Fluid Simulation like “From Dust”, or something similar, in C#/Unity3D?

So, for a game project I’m going to be working on I need to make a fully working 3D fluid simulator in Unity3D using C#, that can work in real time.

The only problem is, I’ve never done anything like fluid simulation. I’ve been doing tons of research on it, and I think a Eulerian based fluid simulator would fit my needs best (just like this).

Basically what I need is something that can react to changing terrain and move realistically.

The people that made that simulator have a research paper online, and I’ve read through it. I understand the basics, but I have no idea how I could get that in to C# or Unity3D. So I was wondering if any of you could help me, either by linking to other fluid-simulators where the code is open source, so I can pick it apart and change it to my needs, or by giving me tips on where to start/what I would need to do.

I’ve spent hours looking online for fluid simulators, but haven’t found a single one programmed in C# as of yet, I have a program that can convert C++ to C#, but I don’t understand C++ well enough to know where to put the scripts in Unity once they’re converted.

Any help at all would be extremely appreciated, I’m really interested in teaching myself how to make this system, but I just have no clue where I should start, or what has already been done that I could build off of.

This is cutting edge technology, using all sorts of advanced maths to make it accurate and advanced programming to make it fast. Here are the underlying equations that even simple fluid sims use: Laplace's equation - Wikipedia

I’ve been programming games for over a decade, and I would run a mile from fluid dynamics :slight_smile: Unless you’re comfortable with coding differential equations, I recommend designing around it or faking it using a simpler algorithm that’s inaccurate but cheap.

Check out some of the simpler sims here, maybe you can adapt one to your needs: Water Simulation