WebGL-Fluid-Simulation README

The project's README from github.com/PavelDoGreat/WebGL-Fluid-Simulation. As one markdown file: README.md.

WebGL Fluid Simulation

Play here

References

https://developer.nvidia.com/gpugems/gpugems/part-vi-beyond-triangles/chapter-38-fast-fluid-dynamics-simulation-gpu

https://github.com/mharrys/fluids-2d

https://github.com/haxiomic/GPU-Fluid-Experiments

License

The code is available under the MIT license

WebGL-Fluid-Simulation (PavelDoGreat/WebGL-Fluid-Simulation)

canvas
Searching Database…

What is this?It is an interactive WebGL demo that simulates fluid dynamics in real time, letting you swirl colorful liquid-like effects with your mouse or finger directly in the browser.
Is this a library I can integrate, or just something to play with?It is a self-contained interactive demo, not a packaged library - the repo is the simulation code plus a page you open and play with directly.
How do I try it?Open the hosted demo linked in the README to play with it instantly, or clone the repository and open the page locally if you want to tinker with the code.
Do I need to install anything special to run it?No installs, accounts, or API keys are needed - just a browser with WebGL support, since the simulation runs entirely client-side using GPU shaders.
Does it work smoothly on every device?Performance depends on the device's WebGL support; it is designed to work even on mobile, but very old browsers without WebGL won't be able to run it at all.
Does it need a powerful graphics card?It relies on WebGL/GPU shaders to solve the fluid math each frame, but it is lightweight enough to run on integrated graphics and mobile GPUs.
What are the Navier-Stokes equations it's based on?They are the equations describing how fluids move; this project solves a simplified version of them on the GPU every frame to produce the swirling color effects.
Can I reuse this fluid effect on my own website?Yes - since the code is MIT-licensed and self-contained, you can copy the shader and simulation logic into your own site and adapt it for custom visual effects.
Why does the mouse interaction also work with touch on mobile?The input handling treats touch and pointer events the same way the mouse is handled, so swiping a finger stirs the fluid just like moving the mouse does on desktop.
Size
3.2 MB
Stars
16.7K
Updated
CommitNov 12
Age
9y
Commits · 90 Days