View on GitHub

Project3-cuda-path-tracer

GPU-accelerated path tracer

Download this project as a .zip file Download this project as a tar.gz file

CUDA Path Tracer

University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 3

Overview

A GPU based path tracer that supports several common material effects. Stream compaction performance is optimized to loosely match that of Thrust.

Features

Raycasting debug. Left shows raycasting directions mapped from (x,y,z) to (r,g,b). Right shows the first intersection normal.

Diffuse and perfect specular surfaces. The perfect specular shown in this image is incorrect. It's been replaced by non-perfect specular implementation.

Non-perfect specular surfaces. Higher specular exponent yields clearer reflection images.

Refractions. Higher IOR results in more distorted images.

Subsurface scattering(SSS). Object "thickness" and distance to light source are two major factors of SSS intensity.

Subsurface scattering(SSS) with reflections. Materials are combined to produce the end result.

More SSS. Object "thickness" and distance to light source are two major factors of SSS intensity. Below shows results from multiple distances. "Thickness" is more or less conceptually equivalent to unlit side's distance to light source.

Antialiasing comparison. Notice the jagged refraction on the right.

Depth-of-field comparison. Objects outside the focal plane are blurred.

Analysis

Open vs. closed scene. Closed scene has many more active (unterminated) rays in each depth.

Stream compaction performance. Time is for a complete trace (intersection test, paint, stream compaction, scatter). Difference is the stream compaction performance difference.

Optimization

Baseline: cornell6, 200*200, scan block size 64

Occupacy as a function of block size.

Optimization baseline.

Optimized result.

Appendix

Scenes list

Performance test data

Open scene
800 * 800 cornell1
Depth: 0 / Grid size: 625125
Depth: 1 / Grid size: 497276
Depth: 2 / Grid size: 406024
Depth: 3 / Grid size: 326613
Depth: 4 / Grid size: 264707
Depth: 5 / Grid size: 214660
Depth: 6 / Grid size: 174592
Depth: 7 / Grid size: 141986
Closed scene
800 * 800 cornell5
Depth: 0 / Grid size: 624854
Depth: 1 / Grid size: 608350
Depth: 2 / Grid size: 592705
Depth: 3 / Grid size: 579828
Depth: 4 / Grid size: 568568
Depth: 5 / Grid size: 558072
Depth: 6 / Grid size: 547953
Depth: 7 / Grid size: 538102
Custom work-efficient stream compaction
800 * 800 cornell1
Depth: 0 / Grid size: 625107 / Time: 97.423164
Depth: 1 / Grid size: 511896 / Time: 99.192924
Depth: 2 / Grid size: 434527 / Time: 84.930527
Depth: 3 / Grid size: 359734 / Time: 73.663490
Depth: 4 / Grid size: 303851 / Time: 62.820320
Depth: 5 / Grid size: 255227 / Time: 54.307522
Depth: 6 / Grid size: 216026 / Time: 47.650337
Depth: 7 / Grid size: 182477 / Time: 41.597088
Thrust
800 * 800 cornell1
Depth: 0 / Grid size: 625107 / Time: 92.244354
Depth: 1 / Grid size: 512883 / Time: 94.210144
Depth: 2 / Grid size: 435087 / Time: 80.382782
Depth: 3 / Grid size: 359297 / Time: 67.422592
Depth: 4 / Grid size: 303702 / Time: 57.761951
Depth: 5 / Grid size: 255254 / Time: 49.950497
Depth: 6 / Grid size: 215942 / Time: 43.392319
Depth: 7 / Grid size: 182385 / Time: 38.022335