As some of you might have seen I’ve been working on a Path Tracer on the GPU. Path Tracing is ray tracing like technique that is (when done right) a physically correct simulation of light. Usually it is done on the CPU but since the work can be easily parallelized and GPUs are getting more powerful, and more programmable it is now feasible to let the GPU do the bulk of the work. I didn’t use Cuda or OpenCL just plain ‘simple’ DirectX 11 with pixel shaders written in HLSL doing most of the work.

Since it is an assignment (which is due in 40 minutes) I can’t share any source code with you. But I would like to show the video and tell you where you can find the resources to build your own.


(Be sure to select the 720P version, but even then the compression has a hard time with the grainyness that path tracing produces. The actually generated image are grainy but look a lot better.)

Image Gallery

Cornell Box

Depth of Field

Depth of Field 2


Reflectance 2

Different levels of reflectance


The Direct3D 11 Reference

  • Main resource

Wolfram Math World

  • Sphere Point Picking algorithm #2

GPU Gems 3

  • GPU random number generation

Colors, Effects, Code

  • ‘Jitter’ idea for depth of field

The FW1 DirectX 11 Font Wrapper

  • This library is used for font rendering

  • Render Targets
  • Best practices (I recommend the entire tutorial series)

Fundamentals of Computer Graphics, 3rd edition, Peter Shirley & Steve Marschner, 2009

  • Miscellaneous math
  • View/Projection/Perspective transformations
  • Inverse transformations