This project is inspired by the Ray Tracing in One Weekend series, to which I have added some personal twists: unit tests using Catch2, a real-time visualiser using SFML and multithreading using OpenMP. I have also tried to write cleaner and more modular code.
These are some cool images I was able to generate with my raytracer. These have rather high samples per pixel (500 or 700, depending on the image) to produce image of as high quality as possible.
After adding Beer-Lambert's law for absorbance in dielectric materials I got this:
Added Shlick's approximation for reflectance:
Added depth of field:
Note
This project is mostly educational, as it has been developed as a project for my OOP course in my first year of uni. One of my plans is to try to optimise it by parallelising the rendering on the GPU, possibly using CUDA C on NVIDIA GPUs.
Installing the prerequisites, on debian based Operating Systems:
sudo apt-get update && sudo apt-get install -y \
cmake g++ libsfml-devClone the repository:
git clone https://github.com/voaidesr/raytracing.git
cd raytracingThen run, in order to compile:
mkdir build && cd build
cmake .. && make -jTo execute:
./raytracer > img.ppmThis will enable a live display of the image generation process and simultaneously store the image in img.ppm. After the image is generated, you can open the image with any image viewer that supports the .ppm format (e.g., feh).
To run tests:
ctest


