MrMagnifico / cuda-fluid-sim

2D fluid simulation in CUDA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CUDA Fluid Simulation

2D fluid simulator built in CUDA and using OpenGL for visualisation. Based on the paper 'Real-Time Fluid Dynamics for Games' included in this repository. Please refer to the paper for a description of the parameters.

eye-candy

Build Instructions

As this project uses CMake, simply use your favourite CLI/IDE/code editor and compile the SolverExec target. A modern C++ and CUDA compilers are needed. All required libraries and resources are provided in this repository

Implementation Details

  • Each pixel in the window is modelled as a cell with separate floating point RGB components
  • Shared memory is heavily utilised to accelerate computation within thread blocks
  • Simulations are done in CUDA memory buffers and their results are copied over to OpenGL textures for display
  • Exposure tonemapping is carried out to map from 32-bit floating point values to 8-bit sRGB colour values

About

2D fluid simulation in CUDA


Languages

Language:C++ 74.5%Language:Cuda 17.0%Language:CMake 6.8%Language:GLSL 1.2%Language:C 0.6%