OpenCL Ray Tracer

A comparison program


Key Details

Made using C++, OpenCL, SDL and LodePNG.

Final year University Assignment - Graded as a 1st.

Required implementing a basic Ray Tracer that could be used with and without OpenCL.

Uses OpenCL to utilise parallel programming using the GPU.

Had to create performance functions to output time taken.

I used this information to compare the two methods in a report.

Source code on GitHub

Online version of the documentation


The second assignment for Graphics and Computational Programming in level H at Bournemouth University. Created using SDL and LodePNG. For this assignment we were told to implement a basic Ray Tracer (without having to worry about need to consider lighting effects) and implement it using parallel programming on a GPU. I decided to use OpenCL for the parallel programming. I used LodePNG to export the renders to png images and then display those with SDL. I was also asked to compare the performance of a ray tracer on the CPU and GPU so I display the time it takes to run the ray tracer on the screen with different scenes. The different scenes have different numbers of objects in the scene to help give different data for the results. I used the information that I collected to compare the two methods in my report. Unsurprisingly the GPU ray tracer is much faster, with the exception of when the scene has so few objects that it is quicker to use the CPU ray tracer than it is to initialize the GPU ray tracer. This assignment was graded as a first.

© 2024 Jamie Slowgrove