A differentiable Monte Carlo path tracer
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake add openexr to submodule Feb 3, 2019
embree @ d5a1ee3 add embree to submodule Feb 3, 2019
examples remove unnecessary file Dec 31, 2018
fit_ltc Initial commit Nov 10, 2018
openexr @ eb2392c add openexr to submodule Feb 3, 2019
openexrpython @ 11c1851 add openexrpython to a submodule Dec 24, 2018
pyredner Use python properties to recompute Feb 12, 2019
tests fix roughness texture Feb 4, 2019
thrust @ 417d784 license Nov 10, 2018
tutorials refine tutorial text Feb 4, 2019
.gitignore SH example Dec 31, 2018
.gitmodules add embree to submodule Feb 3, 2019
CMakeLists.txt add embree to submodule Feb 3, 2019
LICENSE license Nov 10, 2018
README.md Update README.md Feb 3, 2019
active_pixels.cpp cleanup Feb 11, 2019
active_pixels.h cached allocator for thrust Feb 11, 2019
area_light.cpp environment map Dec 24, 2018
area_light.h Fix CUDA compile Feb 4, 2019
buffer.h Avoid reallocation Feb 10, 2019
camera.cpp Fix a memory bug Feb 10, 2019
camera.h intrinsic matrix Feb 10, 2019
channels.cpp Fix CUDA compile Feb 4, 2019
channels.h add position channel Feb 2, 2019
cuda_utils.h Initial commit Nov 10, 2018
edge.cpp remove a few assertions to make CUDA compiler happy Feb 21, 2019
edge.h Fix CUDA compile Feb 4, 2019
envmap.cpp cached allocator for thrust Feb 11, 2019
envmap.h Merge pull request #19 from jpchen/master Feb 20, 2019
frame.h Initial commit Nov 10, 2018
intersection.h merge with windows patch Feb 2, 2019
line_clip.h Initial commit Nov 10, 2018
load_serialized.cpp Initial commit Nov 10, 2018
load_serialized.h Initial commit Nov 10, 2018
ltc.inc Initial commit Nov 10, 2018
material.cpp fix diffuse texture Feb 4, 2019
material.h Use std::make_tuple instead of uniform initializer Feb 18, 2019
matrix.h intrinsic matrix Feb 10, 2019
miniz.c Initial commit Nov 10, 2018
miniz.h Initial commit Nov 10, 2018
parallel.cpp g buffer example Feb 2, 2019
parallel.h change default gpu block size Feb 2, 2019
pathtracer.cpp Fix thrust reduction Feb 12, 2019
pathtracer.h multi-channel output Feb 2, 2019
ptr.h Initial commit Nov 10, 2018
py_utils.h Initial commit Nov 10, 2018
ray.h preallocate optix buffers Feb 11, 2019
redner.cpp intrinsic matrix Feb 10, 2019
redner.h Fix numerical issues in envmap Feb 20, 2019
sampler.cpp Initial commit Nov 10, 2018
sampler.h environment map Dec 24, 2018
scene.cpp Change block size Feb 11, 2019
scene.h preallocate optix buffers Feb 11, 2019
setup.py Initial commit Nov 10, 2018
shape.cpp merge with windows patch Feb 2, 2019
shape.h Fix CUDA compile Feb 4, 2019
test_utils.h Initial commit Nov 10, 2018
texture.h Fix CUDA compile Feb 4, 2019
thrust_utils.h fix thrust allocator Feb 12, 2019
transform.h Initial commit Nov 10, 2018
vector.h Fix mipmapping & ray differential derivatives Nov 27, 2018

README.md

redner

News 02/02/2019 - The wiki now contains a series of tutorial. The plan is to further expand the examples.

redner is a differentiable Monte Carlo renderer that can take the derivatives of rendering output with respect to arbitrary scene parameters, that is, you can backpropagate from the image to your 3D scene. One of the major usages of redner is inverse rendering (hence the name redner) through gradient descent. A distinct feature of redner is that it is physically-based -- which means it simulates photons and produce realistic lighting phenomena, such as shadow and global illumination, and it handles the derivatives of these features correctly.

For more details on the renderer, what it can do, and the techniques it use for computing the derivatives, please take a look at the paper: "Differentiable Monte Carlo Ray Tracing through Edge Sampling", Tzu-Mao Li, Miika Aittala, Fredo Durand, Jaakko Lehtinen [https://people.csail.mit.edu/tzumao/diffrt/].
Since the submission we have improved the renderer a bit. In particular we implemented a CUDA backend and accelerated the continuous derivatives significantly by replacing automatic differentiation with hand derivatives.

redner is expected to be used with PyTorch, and can be used seamlessly with PyTorch operators. A good starting point to learn how to use redner is to look at the wiki. While the documentation is work in progress, you can take a look at the tests directory to have some ideas. redner inherits a subset of Mitsuba scene format, see tests/test_teapot_reflectance.py and tests/test_teapot_specular.py for examples of loading Mitsuba scene files. There is also a Wavefront obj file loader for individual meshes, take a look at tutorials/02_pose_estimation.py.

redner depends on a few libraries/systems:

I recommend using conda to setup the Python related dependencies, e.g.:

conda install pybind11
conda install pytorch-nightly -c pytorch

redner uses CMake as its build system. You need CMake 3.12 or above to build redner. The build procedure follows common CMake instructions. Ideally,

mkdir build
cd build
cmake ..
make install -j 8

should build and install the project, but you may need to tell CMake where the dependencies are by defining the following variables:

Python_INCLUDE_DIRS
Python_LIBRARIES
EMBREE_INCLUDE_PATH
EMBREE_LIBRARY
OptiX_INCLUDE
CUDA_LIBRARIES
THRUST_INCLUDE_DIR
optix_prime_LIBRARY
CUDA_curand_LIBRARY

I suggest using ccmake or other interfaces of cmake to setup the variables.

See here for build instruction on Windows.

redner is tested under MacOS with clang 7 and Ubuntu with gcc 7. In general any compiler with c++14 support should work.

The current development plan is to enhance the renderer. Following features will be added in the near future (not listed in any particular order):

  • Stratification of random number
  • More BSDFs e.g. glass/GGX
  • A properer secondary edge sampling strategy (to make the renderer computation friendlier to GPU, we temporarily dropped the hierarchical edge sampling algorithm described in the paper, and instead used an importance resampling strategy. see edge.cpp )
  • Support for edge shared by more than two triangles (The code currently assumes every triangle edge is shared by at most two triangles. If your mesh doesn't satisfy this, you can preprocess it in other mesh processing softwares such as MeshLab)
  • Source-to-source automatic differentiation
  • Improve mipmapping memory usage, EWA filtering, covariance tracing
  • Russian roulette
  • Distribution effects: depth of field/motion blur
  • Proper pixel filter (currently only support 1x1 box filter)
  • Mini-batching
  • Volumetric path tracing (e.g. http://www.cs.cornell.edu/projects/translucency/#acquisition-sa13)
  • Documentation

If you have any questions/comments/bug reports, feel free to open a github issue or e-mail to the author Tzu-Mao Li (tzumao@mit.edu)