ACM Transactions on Graphics - 2021
Miguel Crespo
·
Adrian Jarabo
·
Adolfo Muñoz
Table of Contents
⚠ WARNING: Cloning the repository
Our library VILTRUM: Varied Integration Layouts for arbiTRary integrals in a Unified Manner is defined as a submodule. You need to use the following command to fetch it correctly:
git clone --recursive https://github.com/mcrescas/viltrum-mitsuba.git
If you already cloned the repository and forgot to specify this flag, it’s possible to fix the repository in retrospect using the following command:
git submodule update --init --recursive
This repository contains the source code of the paper Primary-Space Adaptive Control Variates using Piecewise-Polynomial Approximations by Miguel Crespo, Adrian Jarabo, and Adolfo Muñoz from ACM Transactions on Graphics.
The implementation is based on Mitsuba 0.6, see the README in its repo for more information.
This code is released under the GPL v3. Additionally, if you are using this code in academic research, we would be grateful if you cited our paper, for which we generated with this source code:
@article{crespo21primary,
title = {Primary-Space Adaptive Control Variates using Piecewise-Polynomial Approximations.},
year = {2021},
journal = {ACM Transactions on Graphics},
author = {Crespo, Miguel and Jarabo, Adrian and Mu\~{n}oz, Adolfo},
volume = {40},
number = {3},
issn = {0730-0301},
url = {https://doi.org/10.1145/3450627},
doi = {10.1145/3450627},
issue_date = {July 2021},
month = jul,
articleno = {25},
numpages = {15},
}
Our technique is mainly contained as custom plugins inside Mitsuba, which are built on top of our custom library VILTRUM: Varied Integration Layouts for arbiTRary integrals in a Unified Manner. Note that a few modifications to the source code of Mitsuba were required, so our plugins are not completely independent.
- Our agnostic custom library deals with all the arithmetic required by our system, and can be found in
mitsuba/ext/viltrum
folder. - Our integration with Mitsuba can be found inside
mitsuba/src/integrators/quad
folder.- We have develop a main entry point for all of our specific integrators inside
quadrature.cpp
file, which defines an integrator calledquad
that launch our technique. - Specific code for each type of integral can be found inside the corresponding file in that folder. This includes:
- Our modified Path Tracer inside
pathTracer.(h|cpp)
. - Our modified Volumetric Path Tracer inside
singleScattering(...).(h|cpp)
. - Our modified Heterogeneous media transmittance estimation inside
heterogeneous.cpp
. - Our different transmittance estimation techniques inside
tracking
folder.
- Our modified Path Tracer inside
- We have develop a main entry point for all of our specific integrators inside
- Several extra utilities can be found inside
mitsuba/src/integrators/quad
folder.- Sampler used to pass to the different integrators the evaluation points in the hyper cube inside
quadSampler.(h|cpp)
. - Modified area light that supports defining radiance using a texture inside
areaColor.cpp
. - Modified independent sampler that uses a random sampler, generating a different noise pattern while rendering using only one thread inside
independent.cpp
. - Integration of OpenVDB in Mitsuba 0.6 inside
vdbvolume.(h|cpp)
(disabled by default).
- Sampler used to pass to the different integrators the evaluation points in the hyper cube inside
- Other modifications of the original code of Mitsuba are related with changes in the interface of its components (e.g: lights interface or monte carlo integrator interface)
The idea of our integration with Mitsuba 0.6 is the following: because our technique cannot be use with the sampling interface, we need to take care of all the life cycle of an standalone integrator. In a basic way, our library in mitsuba/ext/viltrum
works by using a generic function F
. Our integration with Mitsuba is designed to provide that function (callback_samplePoint (const Array& values, RNG& rng, bool customRNG)
) and save the result into disk. We have two interfaces in our custom library (integrator and stepper). This is the main reason of our double implementation of auxRenderInternalFinal(STEPPER& integrator, RESOLUTION& resolutionBins, std::string pathResult="")
Indeed, quadrature
plugin launch a custom "integrator" of our library mitsuba/ext/viltrum
while instantiating in addition an integrator of Mitsuba. While most of our parameters can be left as default for all scenes, there are a few of ones that need to be taken into account depending on the problem.
Name | Explanation |
---|---|
spp | Total budget of samples used by the algorithm |
n_dims | Number of dimensions for which the control variate will be built |
scaleSpp | (1/scaleSpp)*spp samples of the total will be used to build the control variate. The rest will be used to compute the residual |
maxDepth | Maximum depth of the subintegrator. If different from maxDepthQuad, it means the number of higher dimensions computed with Monte Carlo. |
maxDepthQuad | Depth at which the control is to be constructed. (Optional: fallback maxDepth value) |
typeIntegrator | Name of the integrator to be used |
typeSubIntegrator | Name of the Mitsuba integrator to be used with our technique |
higherQuadRule | What quadrature rule to use as the higher one : simpson or boole . Defaults to simpson |
error_size_weight | Factor of our heuristic that depends on the size of the hyper region. Defaults to 0.00001 |
Name | Explanation |
---|---|
quad | Only adaptive quadrature without residual integration |
cv_pixel_alphaOpt | Our full technique featuring adaptive quadrature, control variate and optimizing alpha |
munoz2014 | [Muñoz 2014] implementation |
mc | Monte Carlo integrator |
Name | Explanation |
---|---|
path | Path tracer |
singleScattering | Volumetric Path tracer |
singleScatteringEquiangular | Volumetric Path tracer using equiangular sampling |
singleScatteringVRL | Volumetric Path tracer using Virtual Ray Lights [Novák 2012] |
Name | Explanation |
---|---|
woodcock | Woodcock tracking |
simpson | Simpson quadrature |
ratiotracking | Ratio tracking |
residualratiotracking | Residual Ratio tracking |
adaptivesimpson | Adaptive Simpson quadrature |
adaptiveboole | Adaptive Boole quadrature |
cvadaptive | Our Adaptive Residual Ratio tracking |
For specific details about the compilation process, we refer to the documentation of Mitsuba 0.6.
Our modifications are integrated with the build system of Mitsuba, so no specific steps are necessary. We have tested our implementation in Ubuntu Linux
using GCC-9
.
We have integrated OpenVDB inside this version of Mitsuba (disabled by default):
- If you want to use it, see
config.py
file in the root of the project and fill the path to each component required of OpenVDB and Intel TBB. - Additionally, go to
src/integrators/Sconscript
file and uncomment line31
refering to ourvdbvolume
plugin.
Furthermore, dependencies of Mitsuba 0.6 are required.
Go to mitsuba
folder and type scons --parallelize
. This will launch the building process using all the cores available in the computer.
We have a few of our scenes ready for testing our technique. The following sections have examples of how to use our system in several different types of problems.
To compute the results, launch in each folder the following command mitsuba -p 1 scene_paper.xml
. Notice that our implementation currently only works in a single thread.
Our technique is integrated inside the transmittance estimation of the heterogenous plugin in Mitsuba. There is no limitation in the scene, as long as our plugin heterogeneousQuad
is used. An example of scene can be found in scenes/hetvol
.
Our single scattering implementation is integrated inside our mega plugin quad
. An example of scene can be found inside scenes/pumpkin
.
Our direct illumination implementation is integrated inside our mega plugin quad
. An example of scene can be found inside scenes/dragon
.
⚠ WARNING: Missing dragon model
Due to limitations of Github, you need to download XYZ RGB - Asian Dragon model from Stanford 3D Scanning Repository and put it in the folder with namedragon.ply
Our distribution effects implementation is integrated inside our mega plugin quad
. An example of scene can be found inside scenes/chess
which features depth of field.
Note that in this case the number of dimensions should be 3
when dealing with motion blur, 4
while dealing with depth of field or 5
while dealing with both effects.
Our framework can be used to evaluate higher-dimensional integrals while keeping our control variate working in the lower ones. An example can be found in scenes/chess
. Note that the rendering command is mitsuba -p 1 scene_paper_higher.xml
.