joeylitalien / drmlt-mitsuba

Delayed Rejection Metropolis Light Transport (PSSMLT & MMLT Applications)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delayed Rejection Metropolis Light Transport

This repository contains the bold-then-timid implementation of Delayed Rejection Metropolis Light Transport based on the Mitsuba v0.6 renderer. Note that this work is a fork of the SIGGRAPH 2018 course Light Transport Simulation in the Gradient Domain repository.

If you want to understand the algorithm by looking at the code, you should start with:

  • Multiplexed MLT
    • ./include/mitsuba/bidir/path_sampler.h
    • ./src/libbidir/path_sampler.cpp
  • Delayed Rejection MLT
    • ./src/integrator/drmlt/*

In case of problems/questions/comments, do not hesitate to contact the authors directly.

Dependencies

Mitsuba

Python

Compiling

We provided installation instructions for ArchLinux only, but the installation procedure is similar on Ubuntu using apt install. To install Mitsuba's dependencies, run:

pacman -Sy make boost eigen gcc openexr python3 fftw libpng jasper zlib cmake git awk xerces-c xorg glew openimageio python-pip

Configure and build the project using Cmake:

mkdir build && cd "$_"
cmake ../
make -j

To install the tooling dependencies, run:

pacman -Sy python3 python-pip \
pip install numpy matplotlib pyexr

Delayed Rejection Framework

Our implementation of delayed rejection support three types of frameworks:

  • Original Framework: Proposed by Tierney & Mira [1999]. Suffers from vanishing acceptance at the second stage.
  • Generalized Framework: Proposed by Green & Mira [2001]. Uses reversible jump MCMC to solve the vanishing acceptance problematic by sampling an expensive intermediate state.
  • Pairwise Orbital: Based on the original framework but use an orbital mutations strategy at the second stage to solve the vanishing acceptance problem without the extra sampling computational overhead.

Path Sampling Technique

An important change from the previoux Mitsuba implementation is that now integrator can be run over three different path sampling techniques:

  • Unidirectional Path Tracing (PT): Unidirectional volumetric path tracer.
  • Bidirectional Path Tracing (BDPT): Bidirectional path tracer with Multiple Importance Sampling (MIS).
  • Multiplexed MLT (MMLT): Bidirectional path tracer.

You can find these in src/libbidir/path_sampler.cpp and include/bidir/path_sampler.h.

Integrators

We modified and added the following integrators:

  • src/integrator/pssmlt: This is a modified version of the original PSSMLT algorithm.
  • src/integrator/drmlt: This is the core of our DRMLT algorithm.

You can select between them by using the -D integrator=[pssmlt,drmlt] command-line parameter.

pssmlt

Parameter Description Requirement
technique Path sampling technique Required (Options: path, bdpt, mmlt)
kelemenStyleMutation Use Kelemen or Gaussian mutation Optional (Default: true)
mutationSizeLow Kelemen lower bound Optional (Default: 1/1024)
mutationSizeHigh Kelemen higher bound Optional (Default: 1/64)
sigma Standard deviation of Gaussian mutation Optional (Default: 1/64)

Example

<PATH_TO_MITSUBA_BIN>/mitsuba <PATH_TO_SCENE>/scene.xml -D integrator=pssmlt -D technique=path                      

drmlt

Parameter Description Requirement
technique Path sampling technique Required (Options: path, bdpt, mmlt)
type Delayed rejection framework Required (Options: mira, green, orbital)
acceptanceMap Output acceptance map Optional (Default: false)
timidAfterLarge Perform second stage after a large step Optional (Default: false)
fixEmitterPath Fix emitter subpath during the second stage (Only with the mmlt technique) Optional (Default: false)
useMixture Use an equal weight mixture of both stage and regular Metropolis-Hastings instead of DR Optional (Default: false)
sigma Standard deviation of Gaussian mutation Optional (Default: 1/64)
scaleSecond Scaling ratio of the second stage mutation Optional (Default: 1/10)

Example

<PATH_TO_MITSUBA_BIN>/mitsuba <PATH_TO_SCENE>/scene.xml \
                              -D integrator=drmlt       \
                              -D technique=mmlt         \
                              -D type=orbital           \
                              -D fixEmitterPath=true    \
                              -D acceptanceMap=false

Acceptance Map

When using the drmlt integrator, you can generate an acceptance map using the -D acceptanceMap=true option. Doing so will generate an RGB image such that the R-channel corresponds to the number of accepted samples at the first stage and the G-channel is the same for the second stage. To convert this image to a heatmap, use the standalone script ./tools/stages_heatmap.py. For example, the following command saves the acceptance map during rendering:

<PATH_TO_MITSUBA_BIN>/mitsuba <PATH_TO_SCENE>/scene.xml \
                              -D integrator=drmlt       \
                              -D technique=bdpt         \
                              -D type=orbital           \
                              -D acceptanceMap=true

To generate the actual heatmap, run:

python <PATH_TO_MITSUBA_ROOT>/tools/stages_heatmap.py    \
          -t <PATH_TO_ACCEPTANCE_MAP>/acceptance_map.exr \ 
          -c [0.2,0.8]
Parameter Description Requirement
t Acceptance map Required
c Pixel range (clip) for heatmap images Optional (Default: [0,1])

Mixture

To generate a comparison of our method against a naïve mixture of both stage, use the -D useMixture=true option under the drmlt integrator.

Scenes

Change Logs

  • 2020/07/29: Initial code release

License

This code is released under the GNU General Public License (version 3).

This source code includes the following open source implementations:

  • Screened Poisson reconstruction code from NVIDIA, released under the new BSD license.
  • Mitsuba 0.6.0 by Wenzel Jakob, released under the GNU General Public License (version 3).
  • A small part of Tungsten by Benedikt Bitterli.

About

Delayed Rejection Metropolis Light Transport (PSSMLT & MMLT Applications)

License:GNU General Public License v3.0


Languages

Language:C++ 90.9%Language:C 5.3%Language:CMake 1.6%Language:Python 1.1%Language:Cuda 0.3%Language:Objective-C++ 0.3%Language:GLSL 0.3%Language:XSLT 0.1%Language:Shell 0.1%Language:Objective-C 0.1%Language:Singularity 0.0%Language:CSS 0.0%Language:Makefile 0.0%Language:PowerShell 0.0%Language:Batchfile 0.0%