/tracer

CUDA Path Tracer Project

Primary LanguageC

CUDA Path Tracer

Interactive real-time iterative path tracer in CUDA.

Advanced Rendering Seminar, University of Pennsylvania, Spring 2013

Links: Images, Video

render

Features

  • Diffuse Shading
  • Diffuse Reflection
  • Specular Reflection
  • Fresnel Reflection and Refraction
  • Anti-aliasing
  • Interactive Depth of Field
  • Interactive Camera
  • Interactive Object Manipulation

Two visualization modes:

  1. Fast single bounce ray tracing (default at startup)
  2. Path tracing

Controls

Modes

  • Ray Tracer - Press 1
  • Path Tracer - Press 2

Camera Controls

  • Rotate - Left Click drag
  • Zoom - Right Click drag
  • Pan - Middle Click drag
  • Focal Length - F / Shift+F
  • Lens Radius - G / Shift+G

Object Manipulation

  • Translate - Ctrl + Left Click + drag
  • Scale - Ctrl + Right Click + drag
  • Rotate - Ctrl + Middle Click + drag

Details

Interactive real-time iterative path tracer in CUDA.

Image draw done through CUDA OpenGL Interop, by mapping OpenGL pixel buffer object to CUDA memory, then drawing the pixel buffer out as a texture on a full screen quad.

Path tracing kernel is a per-bounce structure, instead of a mega-kernel structure, in order to minimize thread divergence.

Stream compaction was attempted in order discard dead paths and minimize thread workload. However, the overhead costs and memory coherency issues turned out to negatively affect performance. (If interested, see corresponding commit.)

Cornell Box scene description is hard-coded, but the renderer supports .obj files, with normals, and does soft normal barycentric interpolation across triangle faces.

In addition, there is a fast visualization mode for quickly viewing the scene before path tracing. Instead of OpenGL draw, it uses single bounce ray tracing on CUDA, in order to ensure exact image pixel correspondence with path tracing.

Performance

Hardware: Intel Core i7 2.40GHz, 8.00GB RAM, NVIDIA GeForce GT 650M

At 256x256 buffer size: ~20fps. Approximately converges at ~400 iterations, ~20 seconds.

At 512x512 buffer size: ~10fps. Approximately converges at ~300 iterations, ~30 seconds.

References