This is a fork of Nvidia's RTXDI repo, to which I've added several experimental features, focused on implementing global illumination using virtual lights. The main features added are:
ReSTIR Geometry Sampling Global Illumination, or GSGI, is a global illumination technique which randomly samples points on geometry in the scene, creates virtual lights representing diffuse reflected radiance from those points, and then feeds those lights into the ReSTIR DI algorithm.
A more thorough description of how GSGI works can be found in this blog post.
ReSTIR Photon Mapping Global Illumination, or PMGI, is a global illumination technique which maps photons from lights in the scene, and creates virtual lights at the points they hit. Those virtual lights are then fed into the ReSTIR DI algorithm.
A blog post will be added in the future describing PMGI in more detail.
ReGIR is an exsiting technique (implemented in RTXDI) which improves the quality of initial samples used by ReSTIR by presampling lights for cells arranged in a grid structure. Directional ReGIR modifies this by storing samples within those cells according to the direction of the light source. This allows the initial samples to be chosen based on the BRDF of each pixel, with the goal of increasing the quality of initial samples, particularly for specular lighting.
A blog post will be added describing Directional ReGIR in more detail in the future.
Version 2.2.0.
RTX Dynamic Illumination is a framework that facilitates the implementations of efficient direct light sampling in real-time renderers. It is based on the ReSTIR algorithm published in the paper called "Spatiotemporal reservoir resampling for real-time ray tracing with dynamic direct lighting" by B. Bitterli et al.
Starting with version 2.0, RTXDI also includes ReSTIR GI functionality, which allows applications to apply importance resampling to indirect illumination rendered using path tracing. For more information about the indirect illumination algorithm, see the paper called "ReSTIR GI: Path Resampling for Real-Time Path Tracing" by Y. Ouyang et al. The feature is described in more detail in this document.
For more information about RTXDI, see the NVIDIA Developer Page.
rtxdi-runtime is a submodule that contains the integrable runtime sources that are meant to be included in the application build:
rtxdi-runtime/include/rtxdihas the include files, both for host code and for shadersrtxdi-runtime/include/rtxdi/DIResamplingFunctions.hlsliandrtxdi-runtime/include/rtxdi/GIResamplingFunctions.hlsliare the main shader includes that contain the resampling implementationsrtxdi-runtime/srchas the host code with various utility functions for setting up the parameters and resources for resampling
src contains the sample application host code.
shaders contains the sample application shaders.
donut is a submodule structure with the "Donut" rendering framework used to build the sample apps.
NRD is a submodule with the "NRD" denoiser library.
DLSS is a submodule with the Deep Learning Super-Sampling SDK.
rtxdi-assets is a submodule containing the RTXDI SDK Sample Assets.
Additional content delivered during CMake configuration:
thirdparty/dxc is a recent version of DirectX Shader Compiler.
Note that because the rtxdi-assets submodule uses LFS. Cloning it without LFS installed will result in files containing LFS pointers instead of the actual assets.
-
Install LFS support by following the instructions on git-lfs.com
-
Clone the repository with all submodules:
git clone --recursive https://github.com/NVIDIAGameWorks/RTXDI.git
If the clone was made non-recursively and the submodules are missing, clone them separately:
git submodule update --init --recursive
-
Configure the solution with CMake. The easiest option is to use CMake GUI.
-
Assuming that the RTXDI SDK tree is located in
D:\RTXDI, set the following parameters in the GUI:- "Where is the source code" to
D:\RTXDI - "Where to build the binaries" to
D:\RTXDI\build
- "Where is the source code" to
-
Click "Configure", set "Generator" to the Visual Studio you're using (tested with VS 2019 version 16.8.2), set "Optional platform" to x64, click "Finish".
-
Click "Generate", then "Open Project".
-
Build the solution with Visual Studio
-
Run the
rtxdi-sampleorminimal-sampleprojects.
-
Make sure the necessary build packages are installed on the target system. For Ubuntu 20.04 (amd64), the following command is sufficient:
sudo apt install build-essential cmake xorg-dev libtinfo5
-
Install LFS support by following the instructions on git-lfs.com. Note that on Ubunutu 21.04+ you can simply:
sudo apt install git-lfs
-
Clone the repository with all submodules:
git clone --recursive https://github.com/NVIDIAGameWorks/RTXDI.git
If the clone was made non-recursively and the submodules are missing, clone them separately:
git submodule update --init --recursive
-
Create a build folder:
mkdir build && cd build
-
Configure the project with CMake:
cmake ..
-
Build:
make -j8(example for an 8-core CPU, or use Ninja instead)
-
Run:
bin/rtxdi-sampleorbin/minimal-sample
The RTXDI sample applications can run using D3D12 or Vulkan, which is achieved through the NVRHI rendering API abstraction layer and HLSL shader compilation to SPIR-V through DXC (DirectX Shader Compiler). We deliver a compatible version of DXC through packman. If you wish to use a different (e.g. newer) version of DXC, it can be obtained from Microsoft/DirectXShaderCompiler on GitHub. The path to a custom version of DXC can be configured using the DXC_PATH and DXC_SPIRV_PATH CMake variables.
By default, the sample apps will run using D3D12 on Windows. To start them in Vulkan mode, add --vk to the command line. To compile the sample apps without Vulkan support, set the CMake variable DONUT_WITH_VULKAN to OFF and re-generate the project.
To enable SPIV-V compileation tests, set the GLSLANG_PATH variable in CMake to the path to glslangValidator.exe in your Vulkan installation.
See the Integration Guide.