2D GPU Fluid Sim

Hey.

I just open sourced my GPU fluid sim on github here if anyone is interested.

It is based entirely on @chaoticbob’s CPU version in the CinderFX block so credit to him but I hope the code and shaders might help someone else interested in learning how they work. You can see it in action here.

8 Likes

Hey Felix,

Nicely coded! I’ll give it a try next days.

I made a similar one few years ago (https://github.com/DashAndSlash/Fluido)
With the intent to make it in 3D…well that didn’t happen yet :sweat_smile:
But I still would like to do it at some point…

Anyway, Well done!

Are there any open source 3D fluid sims out there for GL?

(Also - looks really nice Felix!)

Somewhere in david li’s WebGL repos theres probably a couple (or at least multi layered 2D ones):


http://david.li/midismoke/

1 Like

Very nice. just lost half an hour.

@felixfaire I just see a white screen on a retina Macbook Pro (new model), running on Mojave. Any ideas?

when you click or touch the touchpad you should see drops of black fluid on the white background. Though I havent tested it on the newer AMD macbooks… do you see any errors?

Yeah, in my older Macbook with an Nvidia GPU it works fine. In the newer one just the white screen, no errors except for this one that appears on both of them:

2019-01-23 10:42:53.897819-0800 GPUFluid[10707:6172118] [default] Unable to load Info.plist exceptions (eGPUOverrides)
2019-01-23 10:42:54.023149-0800 GPUFluid[10707:6172117] MessageTracer: Falling back to default whitelist

Ah thats irritating, I must have been spoiled by Nvidias more relaxed shader compiler. I’ve had a quick look through the shader files but nothing jumps out as particularly risky / non-standard. I also dont have an AMD machine currently to test some variations unfortunately.

Someone else may be able to advise on common glsl syntax pitfalls / gotchas between Nvidia and AMD.

Ps. Those output messages seem pretty standard even in empty projects i think.