Vulkan Fluid Dynamics - Week 7

I’ve done most of my work in stabilizing the simulation and implementing rigidbody collisions with particles. I’ve also added multiple scenes to the demo and simple interactivity to switch between them.

Update history:


On Compute

Overall, I’ve found that my scope was too high to realistically get compute working within the time frame of this project. I did not realize that I would basically have to re-implement all of my C++ code in a restrictive GLSL language. Instead, I chose to use CPU multithreading and see the performance advantages.


Using IMGUI, I created a simple UI that tracked performance of various stages of the simulation.


As you can see, the performance boost is pretty dramatic.

  • Overall sim time down 62%
  • Velocity grid calculation time down 83%
  • Advection time down 85%
  • Rigidbody calculation time down 85%

It figures when you can take something as parallelizable as fluid particles, threading is effective!

Adding additional scenes

I added some new scenes and vorticity types to the simulation. Here’s an overview:

Vortex Ring

A ring of vorticity which creates a flow direction through the middle.

Vortex Noise

Random vorticity that goes in every direction.

That’s it!

I’ve learned a lot about Vulkan and fluid dynamics on this project. While I don’t see this being practically used in a game, it is a great reference project and was a challenge from start to finish!

Update history: