Home
What is RayON?¶
RayON is an educational and experimental path tracer built in C++ with optional CUDA acceleration. It started as a re-implementation of the classic Ray Tracing in One Weekend series and evolved into a fully interactive raytracer running at > 100 FPS @ 720p on an NVIDIA DGX Spark.
Four rendering back-ends are available at runtime — no recompilation needed:
CPU Single-thread
Reference implementation on the CPU, one pixel at a time. It was the starting point but is in reality useless
CPU Multi-thread
Splits the image into tiles and dispatches them across all available cores using std::async. Typical speedup: 8–16×, depending on your CPU.
CUDA GPU
One-shot CUDA kernel with 32×4 thread blocks, warp-friendly memory layout, and persistent curand states. ~100–500× faster than single-thread CPU.
CUDA Interactive
SDL2 window with progressive accumulation. Orbit, pan, zoom with the mouse. Dear ImGui sliders for live DOF, samples, light intensity, and roughness.
It also features BVH Acceleration, CPU-built, with GPU-traversed Bounding Volume Hierarchy with Surface Area Heuristic (SAH) splitting. This provides 5–50× speedup on scenes with 100+ objects.
Quick start¶
# Build (requires CMake ≥ 3.20, a C++17 compiler, and optionally CUDA + SDL2)
mkdir -p build && cd build
cmake .. --fresh
make -j$(nproc)
# Run
./rayon
# > Choose renderer: 0=CPU 1=CPU-parallel 2=CUDA 3=CUDA interactive
Load one of the bundled example scenes:
See Getting Started for the full setup guide, or YAML Scene Format to author your own scenes.
Explore the docs¶
| Section | What you'll find |
|---|---|
| How It Works | The math: ray equations, material models, BVH, sampling theory |
| Architecture | Code organization, CUDA renderer internals, progressive pipeline |
| Features | Interactive controls, YAML scene format, SDF shapes, OBJ loading |
| Gallery | Curated renders from all available scenes |
| Performance | Benchmark results, speedup tables, tuning tips |