Skip to content

About

10 levels of rendering in CUDA

Topics

Resources

Stars

2 stars

Watchers

2 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

raytracerinc

A CUDA ray-tracer that demonstrates 10 levels of rendering, from textbook ray-casting to a path-traced + denoised final image. Live X11 display, key-bound level switching.

Levels

Key Level What's added
1 Ray casting Hit/miss, colour = surface normal
2 Lambert diffuse One bounce of direct light, no shadows
3 Hard shadows Shadow rays toward each point light
4 Specular Blinn-Phong highlights
5 Reflections Recursive mirror bounces
6 Refraction Glass spheres, Snell + Schlick Fresnel
7 Path traced Monte Carlo GI with cosine-weighted hemisphere sampling, next-event estimation, Russian roulette
8 Denoised Level 7 + edge-aware À-Trous wavelet filter
9 OptiX Stub — requires the NVIDIA OptiX SDK. Falls back to level 5 with a banner.
0 Mesh Same scene but spheres are 20-triangle icosahedra (160 tris total), brute-force ray-triangle

Controls

Key Action
1–9, 0 Switch level
Space Pause/resume camera animation (lets path tracing accumulate)
R Reset path-trace accumulation
Esc / Q Quit

The window title shows the current level and, in path-tracing mode, the accumulated samples-per-pixel.

Requirements

  • NVIDIA GPU with CUDA support
  • nvidia-cuda-toolkit (provides nvcc)
  • libx11-dev

Build & run

nvcc raytracer.cu -O3 -arch=sm_86 -use_fast_math -lX11 \
    -Xcompiler '-Wall -Wextra -Ofast' -std=c++14 -o raytracer
./raytracer

Adjust -arch=sm_XX to match your GPU's compute capability if it is not Ampere.

About

10 levels of rendering in CUDA

Topics

Resources

Stars

2 stars

Watchers

2 watching

Forks

Contributors

Languages