Skip to content

Akkuun/RaytracingEngine

Repository files navigation

Real time RaytracingEngine Project in OpenCL

Spheres Scene

rt.mp4

Prerequisites

  • Linux system (tested on Arch Linux)
  • CMake >= 3.10
  • OpenCL runtime and development headers (e.g. opencl-headers, opencl-clhpp, ocl-icd)
  • Qt6 (Widgets) development libraries (e.g. qt6-base, qt6-tools, qt6-qtbase-devel)
  • C++17 compatible compiler (e.g. g++, clang++)
  • Git

Setup Instructions

1. Clone the repository

git clone [email protected]:Akkuun/RaytracingEngine.git
cd RaytracingEngine

2. Install external libs via Submodule

git submodule update --init --recursive

3. Build and Run the Project

From the project root:

bash build.sh

This will:

  • Create the build directory
  • Run CMake and make
  • Copy the OpenCL kernel / assets / saves files
  • Launch the GUI of the Raytracing-Engine

4. Install Core package (if needed)

Install OpenCL C++ Bindings (CLHPP)

If your system does not provide CL/opencl.hpp, you need to install the OpenCL C++ bindings:

Option A: System package (recommended if available)

  • On Arch Linux:
    sudo pacman -S opencl-headers opencl-clhpp
  • On Ubuntu:
    sudo apt install opencl-headers
    # For CLHPP, download from KhronosGroup if not available

Option B: Submodule/manual install

git submodule update --init --recursive
cd external/OpenCL-CLHPP
mkdir build && cd build
cmake -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF ..

Install Qt6 (required for GUI)

  • On Arch Linux:
    sudo pacman -S qt6-base qt6-tools
  • On Ubuntu:
    sudo apt install qt6-base-dev qt6-tools-dev-tools

Install dependencies depending on your graphics hardware (NVIDIA or AMD)

# For NVIDIA GPUs (Ubuntu/Debian)
sudo apt install nvidia-opencl-icd
# Or on Arch Linux
sudo pacman -S opencl-nvidia

# For AMD GPUs (Ubuntu/Debian)
sudo apt install ocl-icd-libopencl1 mesa-opencl-icd
# Or on Arch Linux
sudo pacman -S opencl-mesa

If you use Intel integrated graphics, you may need:

# Intel (Ubuntu/Debian)
sudo apt install intel-opencl-icd
# Or on Arch Linux
sudo pacman -S intel-compute-runtime

Troubleshooting

  • If you get errors about missing CL/opencl.hpp, ensure CLHPP is installed and included in your CMake configuration.
  • If you update the submodule, you may need to re-run the CLHPP build/install step.
  • For OpenCL runtime issues, check your GPU drivers and OpenCL ICD loader.
  • We encountered winodow bad behavior with Qt6 and Xubuntu, if the pannel are not well aligned, this is caused by a dependacy error.
  • We encountered some FPS performance issue with NVIDIA device, just restart the app to clear this problem.

Keybinds

Pannels control

  • F : toggle panels

Camera controls

  • Z : move the camera forward

  • S : move the camera backward

  • Q : move the camera to the left

  • D : move the camera to the right

  • space : move the camera upper

  • A : move the camera below

  • C : switch static camera to FPS camera (rotation with the mouse)

  • right arrow : rotate the camera to the right

  • left arrow : rotate the camera to the left

  • up arrow : rotate the camera to the top

  • down arrow : rotate the camera to the bottom

Save controls

  • Ctrl + S : save current project

Commands controls

  • Ctrl + Z : undo action
  • Ctrl + Maj + Z : redo action

Screenshots from the engine

Spheres Scene

Minecraft Scene

About

Real time Raytracing engine made with OpenCL cross compatible on AMD or NVIDIA graphics card.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages