Dr Pierre-André Mudry, 2025-2026.
Based on the Ray-tracing In One Weekend series, an amazing resource for discovering ray-tracing magic!
This project started as a hand-made reimplementation of the InOneWeekend ray tracer to better understand how it works. It evolved into an interactive, real-time path tracer with progressive sample accumulation. As a result, there are multiple renderers available:
- CPU single-threaded (useless)
- CPU multi-threaded
- GPU CUDA accelerated
- GPU CUDA real-time raytracing with accumulative sampling
mkdir -p build
cd build
cmake .. --fresh
make -j
./rayon --helpIn interactive mode, the renderer is real-time on the development machine (DGX Spark) with a 100 Hz monitor. Frame rate varies with scene complexity and sample settings, while progressive accumulation keeps the display responsive as samples converge.
It uses stb single-file public domain (or MIT licensed) libraries for C/C++ for opening and saving images as well as immediate-mode GUI controls using Dear ImGui.
Representative renders from different scenes and material setups.
You can load additional examples from resources/scenes/.
Create manually via
mkdir build
cd build
cmake .. --fresh
make -jThis will generate the appropriate compile_commands.json for clangd so that you get syntax highlighting, code completion etc. in VS Code. Additionally, CMake automatically updates the .clangd file with include paths for all subdirectories under src/, ensuring clangd has the correct -I flags without manual maintenance. You can then run from the build directory
./rayon --helpOr all at once:
make -j && ./rayon -m 2Rendered frames are written to rendered_images/ with timestamped filenames such as output_2025-11-15_14-22-09.png. Each run produces a new PNG (timestamp uses local time, second precision), so you can sort files chronologically without overwriting previous renders.
Install extension clangd from LLVM. To make clangd work, ensure compile_commands.json is present (generated automatically from CMakeLists.txt during the cmake phase above). This project uses .hpp for C++ headers as a convention; keeping that convention helps tooling and includes stay consistent.
The project also integrates clang-tidy for static analysis. If clang-tidy is installed, CMake will enable it automatically during builds to check for code issues, style violations, and potential bugs. A .clang-tidy configuration file is provided to customize the checks.
This is all you need. There are tasks created in the .vscode folder that can be launched with CTRL+Shift+P -> Tasks and then you can build, and run. You can even setup key bindings for that.
If required, the documentation can be built with doxygen, which should be run in the main directory. The results are not saved in the git repository to save space.
PRs are welcome, please feel free to contribute.
- Compilation has been tested on
DGX Spark, other platforms are untested yet. - The code depends on a proper installation of
libsdlfor creating the real-time rendering context. It might work without it in non-interactive mode, but this has not been tested. Use at your own risk (or create a PR).








