Skip to content

Smoothed-Particle Hydrodynamics (SPH) Liquid Simulation in Your Web Browser

Notifications You must be signed in to change notification settings

mjwatkins2/WebGL-SPH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smoothed Particle Hydrodynamics (SPH) Fluid Simulation with WebGL

I made this to try to learn something about interactive web development. This was primarily tested on Google Chrome; to increase performance on other browsers or older mobile devices, decrease the number of particles and/or set the rest density to zero. If performance is bad or the fluid behavior is super crazy, update Chrome -- I've noticed sometimes Chrome updates can cause performance issues which subsequent updates fix.

See a live demo here: https://mjwatkins2.github.io/WebGL-SPH/

Responds to mouse movement on desktop, and touch input on mobile:

animation of mouse interaction

Responds to window movement:

animation of window interaction

Another example:

long animation

About

Smoothed-Particle Hydrodynamics (SPH) Liquid Simulation in Your Web Browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published