2D GPU Fluid Sim


#1

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.


#2

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!


#3

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

(Also - looks really nice Felix!)


#4

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


http://david.li/midismoke/


#5

Very nice. just lost half an hour.


#6

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


#7

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?


#8

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


#9

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.