geekzzz / simpleflow

A simple OpenCL / OpenGL fluid simulation and renderer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simpleflow

A simple OpenCL / OpenGL fluid simulation and renderer.

Short demonstration video (youtube)

Warning: Requires a fairly powerful GPU!

Controls:

  • Movement:
    • Mouse to look
    • WASD to move around
    • Q/E to go up/down
  • Waves:
    • R/F to make stronger/weaker
    • V to set power to 0
    • Y/C to rotate direction
    • X to reverse direction
  • Features
    • 1/3 to decrease/increase simulation time step
    • 2 to reverse time step (does not work very well)
    • 4/5 to decrease/increase smoothing iterations
    • 6 to toggle liquid shading
  • Misc:
    • P to pause everything for a second
    • Escape to quit

To make, open the .sln file in Visual Studio and compile, everything that is required should be included in the repository. Currently, only windows is supported, but most of the code (everything that is not user input handling) is platform independent and should work on any platform with a new enough OpenGL.

Screenshot

Particles are simulated using an OpenCL-based Smoothed Particle Hydrodynamics implementation, colliding with a height map. The resulting particles are then rendered and smoothed using screen-space curvature smoothing, and eventually shaded and combined with the heightmap geometry.

About

A simple OpenCL / OpenGL fluid simulation and renderer


Languages

Language:C 94.5%Language:C++ 4.7%Language:GLSL 0.8%