A CPU raytracer developed with a focus on performance
SlothRT is a project that I've worked on in the middle of my 2nd year in BUAS as a part of series of workshops led by Jacco Bikker that took place over the course of two weeks. The workshops went over raytracing basics, image quality, and possible performance improvements.
This project was by no means my first CPU raytracer, so I opted to focus on performance rather than visuals, as that was what my previous raytracer was lacking. The resulting raytracer was able to keep up a framerate of about 10FPS at a resolution of 512x512, with 8.6k triangles in an animated scene, running on a single thread.
The work on this project has served as my first steps in some high performance programming concepts, such as SIMD, advanced spatial data structures, cache coherency, and at a later date multiple thread programming.
The highlight of the project is quite possibly the acceleration structure, which was optimized over the course of the 2nd week of the project to be as performant as possible. Additionally, it was made to resemble modern raytracing APIs such as DirectX raytracing and Optix, where geometry and scene are separate acceleration structures, with the scene referencing the geometry structures. Transforming any of the geometry in the scene, would also refit the acceleration structure to accomodate for the change, rather than rebuild the entirety of it.
I have opted to share the code of the project through github, although it is worth mentioning that because of the little time spent on the project, the code quality has not been prioritized much, resulting in at-times quite unreadable code.