CPU raytracer


The CPU ray-tracer was originally an old project from earlier during my study. Back then I wasn't able to produce the results within the allotted time frame as I had a lot of hardware issues, preventing me from working on it. Hence I had taken it upon myself to redo the project with the new found knowledge I had gathered.

In the end the project represents a Whited style ray-tracer that creates images based on a Wavefront model, a skybox and a configured material or a loaded material, that comes with the model. It also supports basic camera effects such as anti aliasing and depth of field.

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

My responsibilities as Graphics programmer:

- Designing the class structure.
- Implementing a custom BVH - took the implementation from PBRT3
- Intersection methods for: triangles/spheres/boxes.
- Implementing the camera models for perspective and oblique rendering
- Implementing camera effects such as anti-aliasing and depth of field.
- Skybox sampling
- Multithreading to accelerate the raytracing process
- Implementing shading techniques:
    - Blinn phong (and normal coloring)
    - Reflections
    - Refractions
    - Beers law

Image Context: The stanford bunny with a diffuse green material


Evaluation

The takeaway from this project would be: don't re-invent the wheel. Instead do your research thoroughly and find people that have been successful. 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 used PBRT's BVH implementation.

When looking back, this project was a good learning experience and incredibly motivating to work on. It taught me how to read academic papers and when/where I should implement custom solutions.

Image context: the Stanford "OBJ" dragon (12 million triangles) with a diffuse grey material, 8x anti-aliased and 8x depth of field sampled. The dragon itself is standing on a reflective plane.