Skip to content

wallisc/TracerBoy

Repository files navigation

Overview

TracerBoy is a GPU path tracer written in C++ and DX12. Largely this is a hobby project that I work on for fun. Over the years I've continued to iterated on TracerBoy so that it's capable of nice looking renders while also being lightweight and fast.

Example of TracerBoy rendering a van with UI on the right

Physically Based Path Tracing

Rendering is physically based using path tracing and supports a variety of materials/BRDFs.

Render of the bistro scene

GPU-Accelerated

All path tracing is run on the GPU. Multiple optimizations have been implemented to both run fast and ensure good results can be gathered. Techniques include russian roulette, multiple importance sampling, and next-event estimation. While performance is both dpeendant on hardware and content, I find most PBRT content to run at >30 FPS on a RTX 30xx GPU.

Bistro scene from the ORCA library

ML-based Denoising

TracerBoy uses a custom port of Open Image Denoise written in DirectML so that it can integrate with TracerBoy's DX12 pipeline. HW acceleration of ML will be used if available (i.e. Tensor Cores) but is not required.

Comparison of raw path traced image vs a denoised image

Raw path traced output at 8 samples per pixel on the left and same output but denoised on the right

Compatible with all modern GPUs

TracerBoy will run on any DX12 GPU with support for Shader Model 6. TracerBoy is optimized for GPUs with support for DirectX Raytracing and will make full use of hardware support for raytracing. However, TracerBoy also has a software-raytracing implementation used for GPUs without hardwar raytracing which can allow it to run even on laptops

Rendering on a Surface Pro

TracerBoy running on the integrated GPU of my Surface Pro 8

Fun fact: TracerBoy originated as a ShaderToy and the core of it's path tracing code is intentionally written so that it can be run via ShaderToy. In fact, the name TracerBoy is largey a mash up between the words ShaderToy and GameBoy. I periodically update this ShaderToy with the latest TracerBoy updates here.

TracerBoy in ShaderToy

Easy to build

A big emphasis for TracerBoy has been avoiding unnecessary dependancies. The only requirement to build TracerBoy is installing Visual Studio 2022. You should be able to pull down the source, open the solution, and hit run.

About

DX12 Path Tracer with ShaderToy interop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published