A simple raytracing engine written in C++ using OpenCL for GPU accelerated parallel compute and OpenGL for presentation.
The following image shows raytracing using distance-functions for simple 3D geometry i.e plane, sphere, ray intersections. This has been extended to create simple shadows and diffuse lighting.
The engine also supports the classical OpenGL rendering pipeline using vertex data loaded from Wavefront (.obj) files and GLSL shaders.
To build the engine source code, the following dependencies must be satisfied and then the make
command should be run in a terminal. The source code was written and developed on a 64-bit Windows machine so heavy modification may be required to adapt it for your system.
-
A GPU that supports
-
OpenCL version 3.0 or higher
-
OpenGL version 3.2 or higher
-
-
NVIDIA GPU Computing Toolkit (Edit the OPENCL path in the CMakeLists.txt file)
-
Download the correct binaries and headers for your system:
-
GLFW
-
GLEW
-
stb - headers only
-
glm - headers only
and place them in the include and libs directories in a subdirectory with the name of the library.
-
-
GNU Make and CMake
-
Visual Studio Build Tools 2022