Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
2D liquid simulation in WebGL
| Date | Stars |
|---|---|
| 2026-07-30 | 311 |
| 2026-10-04 | 312 |
| 2026-11-04 | 312 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# 2D Liquid Simulation in WebGL This project is an implementation of 2D liquid simulation using Smoothed Particle Hydrodynamics in WebGL. [Here is a demo](http://erkaman.github.io/gl-water2d/demo/ ). You can use the demo to place out emitters and capsules and create liquid simulations. You can see some simulations made using the demo below <table><thead> </thead><tbody> <tr> <td align="center"><img src="images/container.gif" alt="Container" width="268" height="336"></td> <td align="center"><img src="images/obstacles.gif" alt="Obstacles" width="268" height="336"></td> </tr> <tr> <td align="center"> <a href="https://raw.githubusercontent.com/Erkaman/gl-water2d/master/json/container.json">container.json</a> </td> <td align="center"> <a href="https://raw.githubusercontent.com/Erkaman/gl-water2d/master/json/obstacles.json">obstacles.json</a> </td> </tr> <tr> <td align="center"><img src="images/red.gif" alt="Red" width="268" height="336"></td> <td align="center"><img src="images/ramps.gif" alt="Obstacles" width="268" height="336"></td> </tr> <tr> <td align="center"> <a href="https://raw.githubusercontent.com/Erkaman/gl-water2d/master/json/red.json">red.json</a> </td> <td align="center"> <a href="https://raw.githubusercontent.com/Erkaman/gl-water2d/master/json/ramps.json">ramps.json</a> </td> </tr> <tr> <td align="center"><img src="images/simple.gif" alt="Simple" width="268" height="336"></td> <td align="center"><img src="images/sprinkler.gif" alt="Sprinkler" width="268" height="336"></td> </tr> <tr> <td align="center"> <a href="https://raw.githubusercontent.com/Erkaman/gl-water2d/master/json/simple.json">simple.json</a> </td> <td align="center"> <a href="https://raw.githubusercontent.com/Erkaman/gl-water2d/master/json/sprinkler.json">sprinkler.json</a> </td> </tr> </tbody></table> [You can see the full simulations in this video](https://www.youtube.com/watch?v=SHvIOMl7-pQ). You can import the JSON files into the demo to run the simulations yourself, by copying the json and pressing the import button(if you are having problems, see the FAQ!). **But note that these simulations were renderered offline**, and they will probably not run in real-time for you. Note that the implementation is not very efficient, and using too many particles(about more than 1500) will slow down the GUI and the entire simulation. ## Brief Technical Details The water simulation is based on the paper [Particle-based Viscoelastic Fluid Simulation](http://www.ligum.umontreal.ca/Clavet-2005-PVFS/pvfs.pdf), which describes a variation of Smoothed Particle Hydrodynamics. But not all details of the paper are implemented. The implemented parts are Double Density Relaxation(section 4), and Viscosity Impulses(section 5.3). The environment is all represented by capsulses. This simplifies the code much, because it is trivial to check for collision with a capsule. To handle the collision, we use the formulas derived in [section 4.4.2.2 of"Lagrangian Fluid Dynamics Using Smoothed Particle Hydrodynamics"](http://image.diku.dk/projects/media/kelager.06.pdf#page=33). People wanting an easy-to-read introduction to the field of fluid simulation are referred to ["Fluid Simulation -Siggraph 2007 Course Notes"](https://www.cs.ubc.ca/~rbridson/fluidsimulation/fluids_notes.pdf). People wanting an introduction to Smoothed Particle Hydrodynamics are referred to ["Lagrangian Fluid Dynamics Using Smoothed Particle Hydrodynamics"](http://image.diku.dk/projects/media/kelager.06.pdf). ## How to Record Offline Simulations The below instructions are what works for me. But I have only tested this on my Mac, so this may or may not work for you. If you can't get it to work no matter what, make I pull request and I will help you. If you press the record button, you will start recording the simulation. This functionality uses the FileSystems API, **so it will only work on Chrome!** Once you press record, the program will start saving the frames of the simulation to some place o
Excerpt of 6,617 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:440193bb8b57f687, topic:simulation