Skip to content

gleery/inkbox

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

i n k b o x

This is an implementation of the fluid simulation system described in "Fast Fluid Dynamics Simulation on the GPU" by Mark J. Harris (a chapter in the book "GPU Gems"). I followed along with the chapter and implemented mostly the same system except using modern OpenGL and GLSL rather than the now-deprecated Cg framework. I've also written a 3D version of the system as well as a WebGL version of the 2D simulation. All three simulations have a UI that lets the user change the parameters of the equations.

2D C++ Simulation

  • A visual representation the velocity, pressure and vorticity fields is shown in the controls window
  • Each step of the solution to the equation can be toggled to see its effect on the fields
  • The constants that are used in the equation can all be modulated
  • Rainbow mode
  • "Droplets" mode

Usage

  • Click and drag to add ink and force
  • Use right-click and drag to only add force
  • Press 'p' key to toggle pause


3D C++ Simulation

  • Mostly functional but there's still a few kinks to work out
  • The constants that are used in the equation can all be modulated
  • Rainbow mode

Usage

  • Click and drag to add ink and force
  • Right-click and drag to rotate cube
  • Use WASD keys to rotate the cube
  • Press 'i' key to add ink at a random location
  • Press 'p' key to toggle pause


2D WebGL Simulation

  • Mostly a straightforward port of the C++ version
  • Hosted on github.io here

Usage

  • Click and drag to add ink and force

Source Material

Credits

About

Fluid simulation using GLSL shaders

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 92.5%
  • GLSL 6.9%
  • C 0.6%