2D Pathtracer
BUAS Block A Project
Project
For BUAS block A we needed to recreate the original metal gear in C++,
For this I wanted some extra challenge so I decided to add a 2D pathtracer to the project
I received a 90/100 grade for this project
First attempt
First I tried to implement this in the 3D way, by sending a ray from every pixel on the screen, I chose this since I thought it would give a more realistic effect and more uniform noise.
However after I implemented this I found out this technique would be way slower in this case and give way more noise.
in 2D rays cannot miss the camera so sending rays from the light source did make more sense
Iterations
After switching to rays from the light source things worked way nicer.
I then started to iterate over the concept.
First i just had simple rays,
Then to reduce the noise I sampled them over time as a form of temperal denoising.
I then made the rays refract and leak into walls when they hit them so walls are also correctly lit.
Then for these wall collisions I added a heightmap to the walls to add a realistic height effect.
Speed
While this gave a good looking effect but it was relatively slow.
So I multithreaded the solution since this is a perfect case for multithreading.
While this worked great I wanted more rays.
So I ended up porting it even to the GPU using compute which made it run really fast