Unity Path Tracing

Offline GPU Path Tracing in the Unity game engine

View on Github

Gallery

Here are some of the renders created by my path tracer:

The Idea

The main idea behind this project was to practice the theory, I learned in the computer graphics courses in university. Having implemented sever smaller real-time projects, I wanted to start a bigger project. I chose a GPU path tracer for this project. I started by learning the basics of Vulkan, but quickly decided to not spend the time with huge amounts of boilerplate code since I wanted to focus on the actual algorithms used for image generation. Here, the Unity game engine comes into play. It provides access to write Compute Shaders in HLSL and already has functionality to load objects, textures and create scenes.

I started by implementing the basics of two tutorials:
  1. GPU Ray Tracing in Unity by David Kuri
  2. Ray Tracing in One Weekend by Peter Shirly
The first served as an tutorial to transfer the scene data of unity to a compute shader and how to optimize the basics. The latter provides a thorough definition of PBR materials which I ported to my shader material system. This serves as the first basic version of my project.

Unity Inspectors

Next Event Estimation and Russian Roulette

Disney BSDF

Rendering the Moana Island Scene by Joe Schutte