A downloadable game

This is a raytracer project created in C++ during my 3rd year of university. It consists of a raytraced scene using the SDL library for rendering. Phong shading, hard shadows, soft shadows, simple geometry and complex geometry are all implemented.

This project was a chance for me to build upon the skills learnt with my OpenGL and Scrabble projects and develop an understanding of how raytracing works on a small scale.

This project consists of a scene with some triangles and spheres created with their own classes and more complex rocks and trees made up of triangles. Rays are sent out from the camera for each pixel of the image and intersection checks are performed with each instantiated object to equate the final pixel colour. A ray is then sent from that intersection point to the light in the scene to equate wether it should be a shadow pixel. With hard shadows, it simply checks with a single point light and sets the colour to either black or the object colour. With soft shadows, a collection of point lights called an "area light" is used and the amount of shadow is scaled accordingly. The user is able to disable/enable functionalities and move the camera. Multi-threading has been implemented, however this leads to artifacting in the image.

Build files to try out the raytracer are available on this page, source files are available on github at the following link: https://github.coventry.ac.uk/bodswor2/301CR

Download

Download
Raytracer.zip 914 kB

Install instructions

Unzip file and run .exe, all included folders and files must be in the same location as the executable.