This repository is a fork of Jan Spindler's Neural Radiance Caching (NRC) implementation with two new modifications and an experimental implementation of two transmittance estimation methods from the paper An unbiased ray-marching transmittance estimator
First modification of NRC is adaptive train batch filtering. It splits input image into batches with a multi level uniform grid. Train batches that contained no scattering events are useless for the training and are excluded from the training. Multi level structure allows to join multiple batches into a single bigger batch to reduce training time.
Second modification of NRC adds cloud density to the input of NRC neural network. This modification increases training speed of the neural network by the factor of 6.
Detailed description of modifications present in this fork are described in the text of my master's thesis stored in the doc
folder of this repository.
To the left base NRC from master
branch, to the right my modified version from combined
branch with both modifications and biased transmittance estimator enabled.
- CUDA v12.1 and NVIDIA GPU with compute capability >= 8.6
- Visual Studio 22. I used Visual Studio 2022 and it is not guaranteed that everything will work on other versions.
- (optional, for plot recreation): Python and Jupyter Notebook
IMPORTANT: some links that vcpkg references are unavailable in Russian Federation. You probably know how to deal with this. Travel to another country, do the installation steps, then go home.
Program was tested only on Windows 11 and instruction is written for x64-windows vcpkg triplet. If you have a different OS, you need to replace x64-windows
in installation steps paths with your respective platform triplet.
Installation steps:
- Install requirements
- Open
Developer Command Prompt for VS 22
. git clone --recurse-submodules -j8 https://github.com/Fenrir7Asteron/NRC-HPM-Renderer.git
cd NRC-HPM-Renderer
- Open
NRC-HPM-Renderer
folder in Visual Studio 22 - Configure root CMakeLists file with right click on Solution Explorer.
In the process of configuring vcpkg will download all dependencies from vcpkg.json. - Return to Developer Command Prompt and execute
.\install-openvdb-<Target>.bat
- Go back to VS, set root CMakeLists as startup item and build the project
Project can be run with default arguments with Visual Studio.
If you want to run it with different arguments through command line you can look up
default arguments at the bottom of src/main.cu
file and meaning of arguments in the include/engine/AppConfig.hpp
.
Built project files are in the out/build/<build-target>
folder.
Startup arguments may vary for different modifications in different branches.
Project can be run in benchmark mode to store performance and quality metrics in the out/build/<build-target>/output/
folder. In order to start project in the benchmark mode you need to set the respective startup argument to 1
.
OutputAnalysis/MetricPlotting.ipynb
notebook can be used to reproduce plots from my thesis using data received from benchmarking.
Different branches contain different modifications of the base NRC implementation:
master
contains unmodified Jan Spindler's base NRC implementationtrain_filter_*
contain several train filtering optionsinput_*
contains various options for additional input to neural networknew_transmittance_estimator
contains implementation of unbiased and biased raymarching transmittance estimators from this papercombined
contains combination of modifications fromtrain_filter_adaptive
,input_density
andnew_transmittance_estimator
branchesapproximate_mie
implements importance sampling by phase function from this paper but it is more noisy than Henyey-Greenstein so it is not used in thecombined
branch