Skip to content

Home

RayON β€” animated prism logo with light rays dispersing into a spectrum

A high-performance CUDA & OptiX path tracer with real-time progressive sampling

What is RayON?ΒΆ

RayON is an educational and experimental path tracer built in C++ with CUDA and OptiX 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.

Two GPU rendering back-ends are available at runtime β€” no recompilation needed:

CUDA GPU

One-shot CUDA kernel with 32Γ—4 thread blocks, warp-friendly memory layout, and persistent curand states.

CUDA Interactive

SDL2 window with progressive accumulation. Orbit, pan, zoom with the mouse. Dear ImGui sliders for live DOF, samples, light intensity, and roughness.

CPU renderers archived

The original CPU rendering backends (sequential and multi-threaded) have been moved to the legacy/cpu-renderer branch. The main branch now supports GPU rendering only.

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.


Sample rendersΒΆ

Lambert & glass shading
Lambert and dielectric glass β€” straight from "Raytracing in one weekend".
OBJ loader with plastic shading
Stanford dragon OBJ loading β€” with plastic shading and scene integration.
Golf ball with procedural displacement mapping
Golf Ball β€” procedural displacement mapping and specular highlights across the dimpled microstructure.
Metallic microfacet anisotropic spheres
Anistropic & Metals β€” microfacet anisotropic SDF rendering (from PBR model).
Thin film shader
Thin film shading β€” oil, soap bubbles... you name it.
Cornell box with area light and colour bleeding
Cornell Box β€” diffuse colour bleeding and soft shadows from a rectangular area light.

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 β€” defaults to interactive mode when SDL2 is present, offline CUDA otherwise
./rayon

# Or pick an explicit renderer with -m:
./rayon -m 2   # CUDA one-shot
./rayon -m 3   # CUDA interactive (SDL2 required)

Load one of the bundled example scenes:

./rayon --scene ../resources/scenes/09_color_bleed_box.yaml -s 512 -r 1080

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