868 points · by joshdance · 7y ago · 102 comments
A simpler one, and without fancy lighting, but with a code walkthrough/tute http://jamie-wong.com/2016/08/05/webgl-fluid-simulation/ ... also doesn't work on my phone. :(
For what it's worth, the Github page references to the GPU Gems book for this effect: http://developer.download.nvidia.com/books/HTML/gpugems/gpug...
Density diffusion: just a hair under 1(visually)
velocity diffusion: 0.99
pressure: 0.93
vorticity: 5
Also, just setting Density Diffusion to 1 and leaving makes the movement slow enough to be able to screenshot nice wallpapers.
It was like a webpage as a wall paper.
Maybe ahead of it's time as it crashed constantly...
Too bad Apple doesn't move forward with WebGL2 and Google splits the community in 2 with webgpu.
It's not splitting the community. They needed a new modern API like what people behind Vulkan did.
With WebGL, in my current projects, the limiting factors are the network, javascript and RAM more than the opengl driver overhead...Maybe the reason behind it is to find common grounds with Apple and supports several investment around Stadia's core technologies?
And OpenGL ES is already at 3.2.
WebGL while impressive, still fails to keep up with what native 3D APIs are capable of.
I don't know enough about fluid dynamics to be the judge, but it seems like the engine is using genuine (2D) physics and it's not just "toy physics." Could someone who knows fluid mechanics comment on this?
[1] https://en.wikipedia.org/wiki/Projection_method_(fluid_dynam...
The numerical methods for solving the PDEs that computer graphics folks use would surely be considered primitive by someone who develops engineering computational fluid dynamics softwares.
http://www.geisswerks.com/milkdrop/
Ryan Geiss' website has some other cool stuff he's worked on:
If I’ll have time for that, maybe I should add custom D3D-specific effects there that weren’t there in the original version. Fluid simulation is one of them. BTW it’s easier to implement with compute shaders. WebGL only support them on Chrome/Chromium and only on desktops, that’s why OP used some trickery with fragment shaders instead.
To have it full screen on mobile, you can use the "add to home screen" feature of your browser"
During my 3rd year at uni I played with webgl1 to create a fake fluid simulation, my demo looks crap nowadays http://jspdown.github.io/mod1/
I met a fellow at Nasa Glen in the 90s that worked on fluid simulations using an sgi workstation. I don’t remember how long the simulations took to process but had to be several minutes per frame. I do remember those workstations cost well over 30 grand at the time.
On a beefy system this could probably handle the full 10 point touch no problem!
I am doing this on a desktop (Arch + Gnome 3) with an Acer touch display.
Well done!
Thanks to the creator.
It can track 10 fingers at once did not even know the iPad could do that.
Looks like it's standard Navier-Stokes.
just a random recommendation: I love to connect this from a laptop to a TV screen, connect a wireless/long cable mouse, and play it with my cousins / little kids. it's a one time trick, but they always love it. (you can do the same with other programs / simulations, just enhancing the experience a little bit can do wonders)
This is really beautiful work.
I suspect the nouveau video driver is the culprit.
I'm currently using Ubuntu 18.04