Skip to content

Realistic water surface rendering in C++ OpenGL using compute shaders

Notifications You must be signed in to change notification settings

maximelianos/water-simulation

Repository files navigation

Real-time water simulation on GPU with OpenGL

CMC MSU, 5 semester bachelor, 2019

Demo video

Build

Required GPU with OpenGL support >=4.3

Linux (Ubuntu) package dependencies: libglfw3, libglfw3-dev

Build with ./compile.sh

Code structure

  • ./*.bmp - image sources
  • main.cpp, common.cpp - main variables, gui loop
  • textured_sphere, textured_wall - underwater objects
  • water_surface - rendering of water
  • shaders/ - vertex, fragment, compute shaders

Features

  • Surface water waves simulation
  • Interactive water disturbing
  • Reflection of "sky"
  • Refraction of light through water, illumination of underwater surfaces
  • A ball placed underwater, also affected by refraction
  • Utilization of compute shaders for water surface simulation and refracted light on underwater objects

Shortcuts

  • Mouse control
  • WASD movement
  • Right click - disturb water surface
  • Q - toggle wireframe water surface
  • F1-F4 - teleport to preset scene

About

Realistic water surface rendering in C++ OpenGL using compute shaders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published