December 14, 2024








OpenGL renders the scene in realtime [left] and the custom raytracer renders it [right].
The objects are purposefully set to be really reflective to showcase the ray tracing. There are also four light sources, one in each corner of the room. That is why the shadows seem to be all over the place!
This is a showcase of a custom ray tracer built in Python as a proof of concept for a computer graphics project. The scene is first rendered in OpenGL and the press of a key can render the current camera view as a ray traced image. Each pixel of the ray traced image is calculated sequentially from top to bottom, left to right. The process is a bit slow compared to modern ray tracing engines, as the simple 500x500 pixel images take a few minutes to render. The ray tracer is built to showcase calculating reflections, refractions, shadows, and ambient occlusion using matrix math and vector algebra. This was a really fun project to work on! I have gained a new appreciation for the complexity of ray tracing algorithms, especially ones that are run in real time.