Unity Fluid GPU by etienne-p - 3

Shaders & Effects

GPU based implementation of a 2D fluid solver within Unity

Unity 2017.3.0f3Unknown LicenseUpdated 2 years agoCreated on April 17th, 2018
Go to source

Unity Fluid GPU

This project is a GPU based implementation of a 2D fluid solver within Unity.

Reference Material

This project is based on the work of Jos Stam on interactive fluid dynamics and the Fast Fluid Dynamics Simulation on the GPU article.


The simulation essentially makes use of 3 components:

  • FluidGPU is the main component running the simulation, it is responsible for performing the various operations involved in a fluid simulation (advect, diffuse, boundary conditions)
  • PoissonSolver is a component solely responsible for solving Poisson Equations using the Jacobi method. It is used by FluidGPU to solve velocity diffusion and pressure.
  • Source is a component responsible for perturbating the fluid, using either the user’s mouse or a procedural motion.

As the simulation runs on the GPU, you’ll find numerical methods corresponding to each fluid update step implemented using shaders in the Assets/Shaders directory.

Please, do not hesitate to comment this work. It is intended as an educational project, and criticism is welcome.

Show all projects by etienne-p