This is my first time trying to tackle raytracing from scratch, I will be documenting my learning journey on everything I do & learn on my website. I try to make it in a way that is simple to understand as much as possible, if you would like to check it out click the blog link above or click here.
Its important to know before hand this project is not fully written from "scratch" but it kind of is atleast the raytracing part. we are mostly using a vulkan image & assigning its pixels to "emulate" a raytracer, but anyway this project is a Walnut template originally & we just built a raytracer ontop of it. Its mostly just ImGUI for UI, GLM for math, & GLFW for window stuff.
I also show how this raytracer works in unity & show the individual rays of how they create a sphere, this is essentially the same algorithim used in my raytracer. To see visualization & images of how my raytracer works you can check either the Repository or Blog.
I used Visual Studio 2022 so I suggest that IDE, but you also need latest version of the Vulkan SDK.
- Visualizing this raytracer in unity Check this out if you are interested in how I visualize THIS raytracer in unity!
- Cherno Raytracing Series Main guide I follow
- Raytracing in 1 Weekend Infamous book for raytracing
- Scratchapixel Learn computer graphics topics & all math prerequisites.
- ssloy More guides about CG topics from ssloy
- My Website documenting this whole project. Check it out if you are interested!
Click here to go to my website where I show much more in a better fashion.
The big stages of my raytracer through stages in 1 image, below has all the steps shown in order.
Camera interactivity was also added.
60% Faster 50ms to 20ms - Utilizing all cores using for each function with a parallel execution parameter.
40% Faster 20ms to 12ms- All cores were using 1 Random Engine, Changed to use thread_local, so each thread has its own random engine.
Process of working towards Emissions | Final Emissions |
---|---|
Weird Diffuse & Specular mix looked cool | Disabling sky color & only showing emission |
Diffuse Only | Yellowish Sun |
The First Emission | Blue Sun |
These improvements might be small but improvements on already low ms are really good in my eyes, kinda think of them as exponential improvements the lower in ms we go.