Skip to content

Repository files navigation

Radiance Caching for Differentiable Path Tracing

⚠️ This is the author's own code release for main table reproductions and is not the official code release from Google. I do not recommend implementing or using radiance cache in Mitsuba in the way used in this codebase; a final code release is underway that is both simpler and faster.

This repository is a modified Mitsuba 3 tree used for the paper experiments. The release includes the modified renderer, the curated playground experiment code, and GUI entrypoints. The main-table scenes are distributed separately from the GitHub repository.

Requirements

  • Linux with an NVIDIA GPU and CUDA-capable driver.
  • A working Mitsuba build environment with Python, CMake, Ninja, and a C++ compiler.
  • Python packages listed in requirements-release.txt.

Install Python dependencies in your environment:

pip install -r requirements-release.txt

LPIPS uses PyTorch. Install the CUDA-enabled PyTorch wheel that matches your system if it is not already installed.

Build

Apply or verify the required Dr.Jit patch before configuring:

patch=playground/misc/drjit/drjit-modifications.patch
if git apply --directory=ext/drjit --check "$patch"; then
  git apply --directory=ext/drjit "$patch"
else
  git apply --directory=ext/drjit --reverse --check "$patch"
fi

cmake -G Ninja -B build-release
ninja -C build-release
source build-release/setpath.sh
python - <<'PY'
import mitsuba as mi
mi.set_variant("cuda_ad_rgb")
import mitsuba.ad.integrators.prb_cache
import mitsuba.ad.integrators.prb_nrc
import mitsuba.ad.caches.volume_cache
import mitsuba.ad.textures.neural_texture
import mitsuba.ad.loaders.ray_loader
print("Mitsuba release build OK:", mi.variant())
PY

Data Layout

Download the main-table scenes from Zenodo: https://zenodo.org/records/21165670. Extract from the repository root:

mkdir -p playground/data/mitsuba
curl -L \
  "https://zenodo.org/records/21165670/files/mitsuba-scenes.tar.gz?download=1" \
  -o mitsuba-scenes.tar.gz
tar -xzf mitsuba-scenes.tar.gz \
  -C playground/data/mitsuba \
  --strip-components=4 \
  code-release/playground/data/mitsuba

This creates playground/data/mitsuba/ with:

  • bedroom
  • bathroom2
  • kitchen
  • living-room
  • living-room-2
  • living-room-3
  • staircase

Each scene should then live at playground/data/mitsuba/<scene>/<scene>/. The playground/data/mitsuba/ tree is intentionally gitignored.

Main Table

The main paper table is the unknown-lighting reconstruction table. It compares Ours, PRB, Hadadan, and Hadadan* on seven scenes, with material-only test-view rendering.

Run the full table from the repository root:

python playground/run_paper_main.py --output-root ../code-release-validation/paper-main

For a quick smoke run:

python playground/run_paper_main.py \
  --scenes living-room-3 \
  --methods Ours PRB \
  --max-iteration 2 \
  --test-view-spp 4 \
  --output-root ../code-release-validation/smoke

The runner writes:

  • paper_main_summary.tsv
  • paper_main_summary.json

To regenerate the summary from an existing output directory without rerunning the experiments:

python playground/run_paper_main.py \
  --summary-only \
  --output-root ../code-release-validation/paper-main

The default comparison thresholds are one-sided and accept improvements over the paper numbers: 1.5 dB PSNR, 0.05 SSIM, and 0.05 LPIPS.

GUI

After building and sourcing build-release/setpath.sh, launch the cache GUI:

cd playground
python run_prb_cache.py data/mitsuba/living-room-3/living-room-3/scene.xml

The standalone neural radiance cache GUI is separate from the paper experiments. It is shared as a public utility and should work with any Mitsuba scene that loads in this release build:

cd playground
python GUI/gui_nrc.py data/mitsuba/living-room-3/living-room-3/scene.xml

About

No description, website, or topics provided.

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages