Writing a full fledge path tracer as an alternative renderer option in my engine has always been on my list but I never got the chance to work on it. There were always some higher priority items on the list. Since last few weeks a lot of ray tracing talks/articles/ demos have been popping up on my twitter feed, and I had some free time this week, so I thought I might make a basic one too.
It’s a super slow and very basic path tracer.Nothing fancy just a bare minimum implementation on CPU single threaded without any optimizations. I started out with one of my very old maths libraries but I thought it would be better to just use DirectXMaths as I am using it in my engine. So I pulled out some maths code and some other utility code from my engine to write this basic path tracer 1-2 days.
Time taken to render 1920 x 1080 image on Intel4770K with 100 rays per pixel is around 50 mins.
Whenever I get some more free time for this, I would like to clean up the code, drop the dependencies on my main engine folder and optimize the code a bit before uploading it.
I still want to make a fully featured path tracer someday probably some GPU based implementation and this hack-N-slash based implementation is far from what I had in mind so I don’t think I would be upgrading this sample in future apart from a quick optimization pass.