Raytracing in a weekend

Custom raytracer based on: "Raytracing in a weekend"

MF-gameplay-1

This raytracer was made with help from the documention of "Raytracing in a weekend"

I also expanded upon the framework to make it more robust. Using a renderer class.

The making of

The documentation I followed was great on a technical level. But I wasn't particularly a big fan of the way it was structured. The way that the rendering was booted and the use of smart pointers in particular. I made an addition class to handle the render loop. To make it easier to handle and more user friendly when expanding upon it later on. And I prefer raw pointers as they are slightly faster than their smart counterparts.

MF-gameplay-1

Limits

A more high-quality render like the one at the top of the page takes about 20 minutes (calculated by the program). This could be much faster by multithreading the different samplesl but I haven't implemented this. But clearly it would be hard for this to run in real time with much more than 4 spheres IF multithreading would be implemented. As such I have not implemented camera movements or other inputs. You can lower the settings of the renders to get a real-time result but this obviously doesn't look great.

The image gets displayed onto a window using SDL2. Before it wrote to a .ppm file but this was quite slow in comparison. That's why I opted to switch to displaying the render onto a window, also because of ease of use.

MF-gameplay-1

Features

Scenes and cameras, spheres, normals, multisampling, true Lambertian reflections (diffuse), gamma correction, materials, (naive) metals, glass, hollow glass, depth of field

RIAW-gameplay-1 RIAW-gameplay-1