Introduction to Vulkan Compute Shaders
For the final project of CENG 469 Advanced Graphics Course, I wanted to do something that involves compute shaders. Because the other project topics either felt too limited (e.g. implementing a single technique like SSR or SSAO) or I didn’t have the required hardware (e.g. real-time ray tracing). With compute shaders, there are infinite possibilities.
To get started with the compute shaders, I decided to implement a GPU particle system with them. Since this is a broad area, I will have the opportunity to extend on it as much as I want after I implement the basics. If you have read my previous blog posts about 469 homeworks, you know I always like experimentation and creative expression.
Presentation
I created a presentation that explains the basics of compute shaders in Vulkan. I originally gave this presentation in real life, but today I decided to record it. Here’s the video:
I thought I should have asked someone to record me during the original lecture, because I found it harder to deliver this presentation in front of the computer. But don’t worry; I recorded some outtakes and edited the vidoe in order to make tt more bearable to watch.
Resources
You can access the slides here.
Also, you can find the repository that contains the minimal Vulkan compute shader application here. It also features a CMake build system, but I only tested it on Linux.
References
The Vulkan code is based on this blog post. In there, you will also find the HLSL implementation of the shader I showed you.
Here’s a link to GPU Gems 3 book I mentioned in the presentation.
Some images has been taken from Cem Yuksel’s lecture about the same topic. I recommend you to watch that lecture if you would like to learn more about the basics of compute shaders and their usage in OpenGL. However, that lecture doesn’t cover the Vulkan side.
Sources of other images:
- OpenGL vs Vulkan slide
- Memory slide
- Particle system slide
- Fire
- Smoke
- Electric zap from Solalien (It’s a link to the game I mentioned)
Further reading: