Skip to content

TU-Clausthal-Rendering/LeakTracing

Repository files navigation

Real-Time Pixel-Perfect Hard Shadows with Leak Tracing

Introduction

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:

Contents:

Demo usage

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).

Controls:

  • WASD - Camera movement
  • Left Click + Mouse movement - Change camera direction
  • Shift - Speed up camera movement
  • Q, E - Camera Down / UP
  • P - 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 more Scenes

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 the scripts folder (Data/scripts in demo).
  • 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:

We may add additional .pyscenes in the future.

Additional Videos

Bistro

Shading:

Shadow only:

Leak Tracing Mask: https://youtu.be/JIExRzhsg1I

EmeraldSquare

Shading:

Shadow only:

Leak Tracing Mask: https://youtu.be/5Q4tDJcg7LM

Low Poly MedievalCity

Shading:

Shadow only:

Leak Tracing Mask: https://youtu.be/9AQAXAAY8_4

Forest (Camera 1 / Camera 2)

Shading:

Shadow only:

Leak Tracing Mask: https://youtu.be/P7VCv-3lfZw / https://youtu.be/1Bbo2nPRSEE

Falcor Prerequisites

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 click Add a feature and select Graphics 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.
  • NVAPI, CUDA, OptiX (see below)

Building Falcor

Falcor uses the CMake build system. Additional information on how to use Falcor with CMake is available in the CMake development documetation page.

Visual Studio

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.

About

Real-Time Pixel-Perfect Hard Shadows with Leak Tracing

Resources

License

Stars

Watchers

Forks