multithreaded raytracer

multithreaded raytracer

Skills Practiced: C++, Parallel Processing, Raytracing
Tools Used: SFML
Project Duration: 3 Weeks
Project Focus: University Coursework

This was created during my time at the University of Abertay, Dundee, as a coursework project for a Parallel Programming module. The coursework specified that we should have an application that ran in parallel on multiple cores, making use of modern multithreading techniques, that it should be thread-safe, and that we should do in-depth analysis of the performance and issues that arose.

I wrote a multi-threaded raytrace renderer, as they are easy to parallelize (by splitting the screen into separate rendering “chunks”, as shown in the image below) and I wanted to further my graphics programming skill. I had previously written a raycast renderer, and so I wanted to improve upon what I already knew with a raytracer that could handle shadows and lighting. chunked rendering
The application used SFML to render a 2D surface from a framebuffer; by splitting the buffer into chunks spatially, it was possible to have the worker threads draw on their own slices of the buffer concurrently, before joining them together to render the frame.

Part of this work included collecting performance metrics and analyising the impact of number of jobs vs number of worker threads; you can see the data in the image below.
multithreading data


© 2024. all rights reserved.