C++ CUDA Raytracer
- gergokocsis
- Jul 22
- 2 min read
For this Level 7 assignment, we had to pick an advanced graphics programming technique and conduct research, implement a solution, then give a presentation on our chosen topic, followed by a QnA session.
Grade awarded: Distinction (89%)
Lecturer's feedback:
"You present a clear explanation of both the mathematics of ray tracing, covering sphere and box intersections, and your implementation in C++ and CUDA of these techniques."
"You consider alternative architectural designs for materials (aggregation vs. composition) critically evaluating the different approaches and showing the code differences between the two approaches, before walking us through the polymorphic classes for the implementation of dielectrics using aggregation."
I saw some funny siny balls in Peter Shirley's book "Ray Tracing in One Weekend" and chose this as my subject. At the same time, I also took some interest in CUDA, and also wanted to learn it. To my luck, Roger Allen also had the same idea some time ago, with "Accelerated Ray Tracing in One Weekend in CUDA". While this blog post helped me get started, I mostly converted the original C++ code to CUDA architectured in a different way, utilising my favourite features of C++ 20.
Pls excuse the potato quality of the video; the original recording captured both screens at the same time, which I then cropped to the main screen only.
Please note, I worked on this project while being in uni 10 am - 9 pm, working on Racecar Crashers for the PlayStation5®. This means that the code is very spaghetti and held together with wishes and instant coffee, because I had to crunch to meet the deadline. You can request access to the repo, but I will not take responsibility for what you will be subjected to.
Comments