The Project

Lumen PT started out with a lot of research into cutting edge ray-tracing technology. Consultation with industry experts resulted in a clear direction with many milestones to reach. Over the course of the year, the six of us faced big challenges when it comes to achieving real-time framerates, solving complex mathematics and writing quality code. This all while working remotely due to the pandemic.

The full source code can be found on GitHub.
The project showcase trailer can be found here.

Research Papers

During the first semester I focused on research. I looked for new technologies that looked promising, and learned about Nvidia's RTXGI, RTXDI, SVGF, DLSS2.0 and other algorithms up for the job. I reached out to multiple industry professionals, including the ones at Nvidia who had written these algorithms. My biggest focus was on ReSTIR (Reservoir Spatio-Temporal Importance Resampling). I read the paper published by Nvidia researchers and came up with an implementation that would fit our project. ReSTIR uses probability theory to learn about the best direct light sources in the scene per pixel. It uses spatial and temporal information to improve the PDF over time. This allows millions of lights to be in the scene with little performance impact. I implemented these algorithms by first making a proof of concept, and then moving them to the GPU using CUDA and Optix. I also implemented algorithms for indirect lighting using random hemisphere sampling based on the BRDF of a surface. I was also responsible for other things such as optimizing and implementing parallel scan algorithms.

Implementation

After finishing my research, I started working on the main rendering pipeline design. This required good hardware knowledge. I proposed a wavefront approach where maximum GPU utilization would be possible. Each path depth is resolved one wave at a time. Shading then happens in parallel in CUDA kernels. I spent a lot of time watching lectures from Utrecht University to ensure I had a good understanding of all things involved. I made multiple diagrams that separate code responsibilities and allowed us to divide the tasks over multiple people within the team. I worked on implementing the probability mathematics to keep our renderer energy conserving. I also implemented many CUDA kernels that do shading and set up the main render core structure to allow path depths to be traced one at a time while appending path contributions. For the last part of the project I mainly focussed on bug fixing, Disney BSDF integration and optimization. I also improved ReSTIR after watching a talk by Chris Wyman.

Project features

The project supports the GLTF 2.0 file format, and I implemented support for the PBR extensions for materials. It is converted into our own custom binary format for faster loading. VDB files can also be loaded for homogenous volumes. The runtime editor allows you to load and transform objects at runtime. The material properties can be overriden per instance and any mesh can be turned into a light by overriding it's emissive properties. Emission happens on a per-triangle basis. Other than this I integrated the Disney BSDF into the project by taking a fast implementation from Lighthouse2 and modifying it a little bit. The project runs at ~20 FPS on 1080p without any upscaling or denoising.

Lessons Learned

Sadly we didn't have time to implement denoising or DLSS upscaling due to having big delays in aquiring acces to the APIs and RTX hardware capable of running the project. This all only arrived after about 90% of the project time had passed. This also caused some delays to performance optimizations, and as such we could not fully convert all our memory accesses to be more cache coherent for the RTX 3000 hardware. This caused a bottleneck in the buffer access for ReSTIR for example. These optimizations would have likely reduced ReSTIR runtime to about ~6ms with 2SPP. Overall I'm very happy with what we achieved with this project though, and it's definitely made me want to further learn about these topics and write even more ambitious projects.

Location

Breda, Noord-Brabant
The Netherlands