A hobby real-time Direct3D 12 path tracer. Mainly developed for learning and experimenting with the latest research in real-time rendering.
To achieve real-time frame rates, this renderer utilizes recent developments such as hardware-accelerated ray tracing (DXR), advanced sampling (ReSTIR), denoising, and smart upscaling (AMD FSR2).
Subway Station based on the NYC R46 subway, rendered by ZetaRay. (Scene by Alex Murias.)
Modern graphics APIs such as Vulkan and Direct3D 12 require resource barriers to be placed manually by the programmer. These barriers control synchronization, memory visibility, and additionally for textures, resource layout. As program complexity grows, manual placement can lead to issues such as:
Furthermore, using multiple command buffers requires a correct submission order—e.g., command list A writes to a resource that is read by command list B, so A has to be submitted before B.
A render graph can help with all of the above; by analyzing resource dependencies, a directed acyclic graph (DAG) is formed from which submission order is derived and barriers are automatically placed. A visualization is shown below.
A sample frame render graph.
Standard CMake build. Make a build directory somewhere you like, then call CMake from inside that directory and point it to (./CMakeLists
) in the top-level project directory (./build
is preferred as it's included in .gitignore
).
The main sample application (Samples/ZetaLab/
) works by loading a glTF scene and then proceeding to rendering that scene while exposing various settings through the UI window.
Note that glTF scenes need to be preprocessed first by generating mipmaps and converting textures to DDS format. A command-line utility app (Tools/BCnCompressglTF
) is provided for that purpose. It can be used as follows:
> cd bin
> .\BCnCompressglTF <path-to-gltf>
The outputs are:
_zeta
suffix (e.g., myscene.gltf
-> myscene_zeta.gltf
) <path-to-gltf-directory>/compressed
directory.For convenience, a preprocessed Cornell Box scene is provided (Assets/CornellBox/cornell9.gltf
). After building the project, you can run it as follows:
> cd bin
> .\ZetaLab ..\Assets\CornellBox\cornell9.gltf
Currently, unicode paths are not supported. Support is planned for a future release.
Subway Station. (Scene by Alex Murias.)
(Modified) Blender Classroom. (Original Scene by Christophe Seux.)
Country Kitchen. (Scene by Jay-Artist.)
Amazon Lumberyard Bistro. (Scene from Open Research Content Archive (ORCA).)
Dining Room. (Scene by MaTTeSr.)
San Miguel 2.0. (Scene from Morgan McGuire's Computer Graphics Archive.)
San Miguel 2.0. (Scene from Morgan McGuire's Computer Graphics Archive.)
Modified Blender 2.81 Splash Screen. (Original scene by Alex Treviño, hair model by bbb59149.)
[1] Y. Ouyang, S. Liu, M. Kettunen, M. Pharr and J. Pantaleoni, "ReSTIR GI: Path Resampling for Real-Time Path Tracing," Computer Graphics Forum, 2021.
[2] S. Hillaire, "A Scalable and Production Ready Sky and Atmosphere Rendering Technique," Computer Graphics Forum, 2020.
[3] MinimalAtmosphere, https://github.com/Fewes/MinimalAtmosphere
[4] B. Bitterli, C. Wyman, M. Pharr, P. Shirley, A. Lefohn and W. Jarosz, "Spatiotemporal reservoir resampling for real-time ray tracing with dynamic direct lighting," ACM Transactions on Graphics, 2020.
[5] J. Boksansky, P. Jukarainen, and C. Wyman, "Rendering Many Lights With Grid-Based Reservoirs," in Ray Tracing Gems 2, 2021.
[6] D. Lin, M. Kettunen, B. Bitterli, J. Pantaleoni, C. Yuksel and C. Wyman, "Generalized Resampled Importance Sampling: Foundations of ReSTIR," ACM Transactions on Graphics, 2022.
[7] OpenPBR Surface, https://github.com/AcademySoftwareFoundation/OpenPBR
MIT license—see LICENSE
for more details.