CPU raytracer


The CPU raytracer was a flawed project from year 1, which didn't produce the results I wanted due to having lots of hardware issues. Hence I had taken it upon myself to redo the project with the new found knowledge I had gathered in between the first and now the second revision.

In the end the project represents a whitted raytracer that creates images based on a loaded model, a skybox and a configured material. 

Group members: 1 graphics programmer
Platforms: Windows
Span: November 2020 - January 2021
Software: Visual studio

My responsibilities as Graphics programmer:

- Designing the structure.
- Implementing a custom BVH - PBRT3
- Implementing shading techniques:
    - Blinn phong (and normal coloring)
    - Reflections
    - Refractions
    - Beers law

Image Context: The stanford bunny with a diffuse green material


Takeaways and processes

The takeaway from this project would be: don't re-invent the wheel. Instead do your research thoroughly and find people that have successful implementations. Learn to understand those implementations and master them. A good example would be the BVH, I was in need of a spatial subdivision structure, since the performance of an intersection test would scale linearly.

For this I took the state of art CPU ray tracer from PBRT, which explained how a BVH is structured and which ways such a structure can be implemented. I am happy I was able to follow along since it was not an easy read.

Apart from that the ray tracer also supports refraction together with Beer's law, though this doesn't seem to create the expected results. The reasoning for me has been unclear and due to time constraints and focus switch on (during this time) Dataflow, I did not manage to resolve this issue.

When looking back, this project was a good learning experience, it taught me how to read papers and when/where I should implement custom solutions. It is however still a shame that the refraction doesn't work like I wanted it to. If I had more time to spend I would definitely look into the issue.