Overview
While implementing compute shaders to my game engine, I thought it would be a really cool idea to simulate my favorite astronomical object inside of it. Little did I know this would end up being an extremely daunting but fun adventure of biblical levels of GREED that would bring me to explore math concepts that go way beyond my comprehension and discover beautiful optimisation techniques.
Anyways heres most of my thought process throughout it.
What I explored
- Compute shader API implementation
- Shader programming
- Variable rate shading
- Volumetric accretion disk rendering
- Path tracing
- R4K integration
- Kerr metric
- Matrix linear-algebra optimisation like the use of Sherman-Morrison formula
- Hamiltonian geodesic integration
STORY TIME
Ever since I first watched interstellar, singularities have always been such a beautiful and complicated thing to me. Something about its natural ability to break our current understanding of physics by simply existing or its ability to create some of the most beautiful views I have ever seen while being mainly completely blac has always seemed so interesting to me. From that point on I have always been at awe at any attempt of simulating singularities and for years have held the "black hole simulation project" as a far fetched dream. After I conquered my fears with vulkan and C++ though, filled with confidence, I decided I would make one for myself.
CHAPTER 1 : The "Simple" black hole
The first hurdle was pretty clear to me, implementing compute shaders into my engine. Coming from unity, I wanted to make something that was as simple and flexible as unity, so i got to it, ....
- Simple black hole shader (jan 8 2026) Now that compute shaders were implemented, it was time to make one.
This was my very first attempt at a black hole shader.

This version used a simple disk function for the accretion disk and simply curved the rays with traditional newton gravity. Obviously extremely unrealistic but hey, its a start, I just needed to make something pretty.
But then I saw this guy who made a black hole using general relativity equations, more precisely he used the schwarzschild metric 3. Kerr newman shader The project is a foundation for experimenting with different weapon types, attachments, and gameplay feedback.
