Fluid Simulation

GitHub

A GPU-accelerated Stable Fluids simulation.

High resolution 2D Stable Fluids simulation running on the GPU.

Key Features

  • GPU-accelerated fluid simulation
  • 2D Stable Fluids
  • 3D Stable Fluids
  • Grass + wind simulation
  • Volume rendering

Description

This was my submission for extra credit on a class project in CSCI 5611: Animation & Planning in Games. The goal of this extra credit was to create a realistic 2D fluid simulation by implementing the Stable Fluids simulation described in Jos Stam's infamous paper. I took it a step further by running my simulation entirely on the GPU via compute shaders, allowing for an extremely high resolution real-time simulation.

Demo

High resolution fluid simulated in realtime using GPU Compute Shaders in Unity.

Other Applications

I recently revisited this project, utilizing it to drive a wind simulation across millions of grass blades generated procedurally on the GPU.

I also expanded the simulation to 3D, producing the following result:

3D Stable Fluids simulation rendered with my custom volume rendering shader to give the appearance of fire.

Tools Used

Assets: Computer Model

Languages: C#, HLSL

Software: Unity