CUDA Path Tracer
CUDA · C++ · glTF · BVH · PBR
Final scene
CUDA
Path Tracer
A GPU-first renderer for glTF scenes, physically based materials, accelerated ray traversal, cinematic camera effects and a configurable post stack.
Lady Maria
of the Astral
Clocktower
Final scene rendered in the CUDA path tracer.
PBR Materials
Metallic-roughness glTF materials, texture sampling, emissive response, dielectric transport and reflective surfaces share the same path-traced lighting model.
Rendering Pipeline
A wavefront CUDA pipeline traces and shades only active paths, one bounce at a time.
Scene Upload
Upload glTF geometry, materials and textures to GPU memory.
Ray Generation
Generate jittered camera rays with anti-aliasing and depth of field.
BVH Traversal
Intersect active rays against scene and triangle hierarchies.
Shade & Compact
Evaluate PBR materials, spawn the next bounce and compact paths.
Accumulate & Post
Accumulate samples, then apply tone mapping and post effects.
Optimization Evidence
Controlled A/B tests show where GPU work was actually removed—and where an optimization cost more than it saved.
Two-Level BVH
A scene hierarchy rejects objects; a per-mesh hierarchy resolves triangles with iterative GPU traversal.
Stream Compaction
Prefix-scan and scatter remove dead paths between bounces so later kernels process only active work.
Russian Roulette
Low-throughput paths terminate probabilistically after a configurable minimum depth with unbiased compensation.
Material Sorting
Measured as a negative optimization: Thrust sort and gather overhead exceeded the coherence benefit.
0.4 → 32 fps
69,451 triangles. Hierarchical traversal turns a linear triangle scan into interactive rendering.
13 → 48 fps
Escaped rays disappear from subsequent intersection and shading kernels instead of occupying lanes.
32 → 37 fps
Closed scenes retain long paths, so energy-based termination saves work without changing the estimator.
BVH scaling
| Scene | Triangles | Linear | BVH | Gain |
|---|---|---|---|---|
| Bunny · Open | 69,451 | 0.4 fps | 32 fps | 80× |
| Bunny · Closed | 69,451 | 1.7 fps | 97 fps | 57× |
| Lady Maria · Open | 1,013,600 | <0.1 fps | 15 fps | Interactive |
| Lady Maria · Closed | 1,013,600 | <0.1 fps | 37 fps | Interactive |
Paths alive after bounce
BVH + compaction
Both remove measurable work across the tested scenes. Compaction gains vary with ray escape rate; BVH gains scale sharply with triangle count.
Material sorting
Cornell Box: 44 → 29 fps (−34%). Bunny: 43 → 32 fps (−25%). Even a 20+ material scene fell from 51 → 42 fps, so sorting is disabled by default.
Camera & Post Processing
Drag each frame to compare the optical and display-space changes without changing the underlying scene.
Bloom & God Rays
Bloom handles display-space energy around bright regions, while occlusion-aware god rays shape directional light through the scene.
CUDA PATH TRACER
CUDA · C++ · glTF · GPU ACCELERATION
A CUDA-based renderer exploring physically based light transport. It supports glTF assets, refraction, specular materials, depth of field, antialiasing and BVH acceleration, with Russian Roulette termination and performance analysis across complex scenes.