31 January 2014

Simple Water Simulation

Simple water simulation
Finally I have managed to publish my awesome water simulation! I know that I wrote about my intentions to publish the project some time ago but as usually there was no enough time :)
The code is quite old and was ready something like 2 years ago. As usually I wanted to polish it and thanks to that it was blocked for too long period of time. This post only introduces the project features and gives general description.

Features

  • Water simulation done on the GPU - shaders
  • Height map based
  • Normal mapping with Phong Shading
  • Uses GPU timer queries
  • OpenGL 4.2 Core
  • FreeGLUT + SOIL + AntTweakBar + my framework
Basic flow of the animation is below:
water simulation flow

As you can see the whole process consists of updating the height map data (using double buffering) then calculating the normal map. The result is applied onto a quad (only four vertex) using normal mapping and Phong shading.

Code and Repo

Application is based on my simple framework, and whole thing can be found at

Screens

Simple Water screen 0

Simple Water screen 1

Simple Water screen 2

Video

This is actually my first video on YouTube! :)

Todo & Ideas

  • Improve camera and add more controls/view options.
  • Add environment!
  • Reflection and refraction.
  • Surface rendering with tessellation

Links and Resources

Interested in new blog posts and occasional updates? Please sign up for my free newsletter.

© 2017, Bartlomiej Filipek, Blogger platform
Any opinions expressed herein are in no way representative of those of my employers.
This site contains ads or referral links, which provide me with a commission. Thank you for your understanding.