This repository contains the source code and an interactive demo for the following EGSR paper:
Real-Time Pixel-Perfect Hard Shadows with Leak Tracing
René Kern, Felix Brüll, Thorsten Grosch
TU Clausthal
This prototype implements Leak Tracing, a hybrid algorithm that combines filterable shadow maps with ray tracing to produce pixel-perfect shadows. Selective ray tracing is employed in regions where filterable shadow maps exhibit light leaks or aliasing. No scene-dependent parameters are required, and the algorithm performs exceptionally well on alpha-tested shadows.
This project was implemented using NVIDIA's Falcor rendering framework. See README_Falcor.md for the readme provided with Falcor.
You can download the executable demo from the Releases Page, or build the project by following the instructions in Building Falcor or the build instructions in the original readme.
Teaser:
After downloading the demo from the releases page, you can execute it using the LeakTracingDemo[SceneName].bat
file. The Bistro and Emerald Square scenes are not included and need to be downloaded separately. After downloading, simply place the entire content of the .zip
file into the respective subfolder of the Models
folder (e.g., so that Models/Bistro/BistroExterior.fbx
exists).
- Bistro: https://developer.nvidia.com/orca/amazon-lumberyard-bistro
- Emerald Square: https://developer.nvidia.com/orca/nvidia-emerald-square
Controls:
WASD
- Camera movementLeft Click
+Mouse movement
- Change camera directionShift
- Speed up camera movementQ, E
- Camera Down / UPP
- Opens the profiler that shows the Rendertime for each Pass ('ShadowPass' is ours).F9
- Opens the time menu. Animation and camera path speed can be changed here (Scale).F6
- Toggels Graphs UI menu (Enabled by default)
UI:
How to add the temporal mask as a debug window:
Testing with other scenes is possible. The following points should be noted when loading other scenes:
- Load the
LeakTracing
renderscript:- Using the
.bat
file (LeakTracingDemo_NoScene.bat
) - Directly in Mogwai with
File->Load Script
. The render pass scripts are in thescripts
folder (Data/scripts
in demo).
- Using the
- A scene can be loaded in Mogwai with
File->Load Scene
. - Leak Tracing supports analytic point, spot and directional lights, although Point lights were sparingly tested. Leak Tracing theoretically supports up to 42 lights, however, anything above 4 lights was not tested and is considered experimental.
- The cascaded level points are set automatically depending on the scene bounding box and may need slight manual tweaking (
ShadowMapOptions -> Cascaded Options
).
Falcor supports a variety of scene types:
- Falcor's
.pyscene
format (more details)- e.g. NVIDIA ORCA
- FBX and GLTF files
- GLTF files often have very bright lights that may need to be toned down.
- Many PBRT V4 files:
- e.g. Benedikt Bitterli's Rendering Resources or PBRTv4 scenes repo
- Does not include analytic lights, which need to be added manually in a
.pyscene
We may add additional .pyscenes
in the future.
Shading:
- Leak Tracing (LtEVSM): https://youtu.be/ysGlQ_99fAQ
- Ray Shadows: https://youtu.be/YRsDtrLxz3M
Shadow only:
- Leak Tracing (LtEVSM): https://youtu.be/vFqeVWm9IQs
- Ray Shadows: https://youtu.be/d5-mf5GyK4o
Leak Tracing Mask: https://youtu.be/JIExRzhsg1I
Shading:
- Leak Tracing (LtEVSM): https://youtu.be/8qCPabjGv80
- Ray Shadows: https://youtu.be/vdDjck3hqd8
Shadow only:
- Leak Tracing (LtEVSM): https://youtu.be/y4AmguwgOoI
- Ray Shadows: https://youtu.be/SPUPvuxlfvw
Leak Tracing Mask: https://youtu.be/5Q4tDJcg7LM
Shading:
- Leak Tracing (LtEVSM): https://youtu.be/l2NFJPCo7Xs
- Ray Shadows: https://youtu.be/c4FQuiKmEbk
Shadow only:
- Leak Tracing (LtEVSM): https://youtu.be/5iubBUVoPWo
- Ray Shadows: https://youtu.be/rG6i6qF7_Mw
Leak Tracing Mask: https://youtu.be/9AQAXAAY8_4
Shading:
- Leak Tracing (LtEVSM): https://youtu.be/rWpflDw3y0U / https://youtu.be/7ypJuqsQh1w
- Ray Shadows: https://youtu.be/dd5rUf4-nak / https://youtu.be/5l9eG2qmoAY
Shadow only:
- Leak Tracing (LtEVSM): https://youtu.be/V95WBmbbLh4 / https://youtu.be/Wj9UMnTY03M
- Ray Shadows: https://youtu.be/F4ykAtW5pag / https://youtu.be/GqOVZushV-A
Leak Tracing Mask: https://youtu.be/P7VCv-3lfZw / https://youtu.be/1Bbo2nPRSEE
- Windows 10 version 20H2 (October 2020 Update) or newer, OS build revision .789 or newer
- Visual Studio 2022
- Windows 10 SDK (10.0.19041.0) for Windows 10, version 2004
- A GPU which supports DirectX Raytracing, such as the NVIDIA Titan V or GeForce RTX
- NVIDIA driver 466.11 or newer
Optional:
- Windows 10 Graphics Tools. To run DirectX 12 applications with the debug layer enabled, you must install this. There are two ways to install it:
- Click the Windows button and type
Optional Features
, in the window that opens clickAdd a feature
and selectGraphics Tools
. - Download an offline package from here. Choose a ZIP file that matches the OS version you are using (not the SDK version used for building Falcor). The ZIP includes a document which explains how to install the graphics tools.
- Click the Windows button and type
- NVAPI, CUDA, OptiX (see below)
Falcor uses the CMake build system. Additional information on how to use Falcor with CMake is available in the CMake development documetation page.
If you are working with Visual Studio 2022, you can setup a native Visual Studio solution by running setup_vs2022.bat
after cloning this repository. The solution files are written to build/windows-vs2022
and the binary output is located in build/windows-vs2022/bin
.