Differentiable Monte Carlo ray tracing through edge sampling

Gradient-based methods are becoming increasingly important for computer graphics, machine learning, and computer vision. The ability to compute gradients is crucial to optimization, inverse problems, and deep learning. In rendering, the gradient is required with respect to variables such as camera parameters, light sources, scene geometry, or material appearance. However, computing the gradient of rendering is challenging because the rendering integral includes visibility terms that are not differentiable. Previous work on differentiable rendering has focused on approximate solutions. They often do not handle secondary effects such as shadows or global illumination, or they do not provide the gradient with respect to variables other than pixel coordinates. We introduce a general-purpose differentiable ray tracer, which, to our knowledge, is the first comprehensive solution that is able to compute derivatives of scalar functions over a rendered image with respect to arbitrary scene parameters such as camera pose, scene geometry, materials, and lighting parameters. The key to our method is a novel edge sampling algorithm that directly samples the Dirac delta functions introduced by the derivatives of the discontinuous integrand. We also develop efficient importance sampling methods based on spatial hierarchies. Our method can generate gradients in times running from seconds to minutes depending on scene complexity and desired precision. We interface our differentiable ray tracer with the deep learning library PyTorch and show prototype applications in inverse rendering and the generation of adversarial examples for neural networks.

[1]  Min Chen,et al.  Theory and application of specular path perturbation , 2000, TOGS.

[2]  Eric Heitz,et al.  Real-time polygonal-light shading with linearly transformed cosines , 2016, ACM Trans. Graph..

[3]  Jaakko Lehtinen,et al.  Practical SVBRDF capture in the frequency domain , 2013, ACM Trans. Graph..

[4]  Jaakko Lehtinen,et al.  Reflectance modeling by neural texture synthesis , 2016, ACM Trans. Graph..

[5]  Dani Lischinski,et al.  Automatic Lighting Design using a Perceptual Quality Metric , 2001, Comput. Graph. Forum.

[6]  Ersin Yumer,et al.  Material Editing Using a Physically Based Rendering Network , 2017, 2017 IEEE International Conference on Computer Vision (ICCV).

[7]  Leif Kobbelt,et al.  Theory, analysis and applications of 2D global illumination , 2012, TOGS.

[8]  Ravi Ramamoorthi,et al.  A first-order analysis of lighting, shading, and shadows , 2007, TOGS.

[9]  Thomas Vetter,et al.  A morphable model for the synthesis of 3D faces , 1999, SIGGRAPH.

[10]  Chenxi Liu,et al.  Adversarial Attacks Beyond the Image Space , 2017, 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).

[11]  Brian E. Smits,et al.  Practical physically-based shading in film and game production , 2012, SIGGRAPH '12.

[12]  Jaakko Lehtinen,et al.  Anisotropic Gaussian mutations for metropolis light transport through Hessian-Hamiltonian dynamics , 2015, ACM Trans. Graph..

[13]  L. Hörmander,et al.  The Analysis of Linear Partial Differential Operators I: Distribution Theory and Fourier Analysis , 1983 .

[14]  Aaron Hertzmann,et al.  Illustrating smooth surfaces , 2000, SIGGRAPH.

[15]  Steve Marschner,et al.  Manifold exploration , 2012, ACM Trans. Graph..

[16]  James Arvo,et al.  The irradiance Jacobian for partially occluded polyhedral sources , 1994, SIGGRAPH.

[17]  Pierre Poulin,et al.  A Light Hierarchy for Fast Rendering of Scenes with Many Lights , 1998, Comput. Graph. Forum.

[18]  Paul Debevec,et al.  Inverse global illumination: Recovering re?ectance models of real scenes from photographs , 1998 .

[19]  Kadi Bouatouch,et al.  Radiance caching for efficient global illumination computation , 2005 .

[20]  Gustavo Patow,et al.  A Survey of Inverse Rendering Problems , 2003, Comput. Graph. Forum.

[21]  Tokiichiro Takahashi,et al.  Principles and applications of pencil tracing , 1987, SIGGRAPH.

[22]  Yuting Yang,et al.  Approximate Program Smoothing Using Mean‐Variance Statistics, with Application to Procedural Shader Bandlimiting , 2017, Comput. Graph. Forum.

[23]  Tatsuya Harada,et al.  Neural 3D Mesh Renderer , 2017, 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition.

[24]  Shuang Zhao,et al.  Inverse volume rendering with material dictionaries , 2013, ACM Trans. Graph..

[25]  Alejandro Conty Estevez,et al.  Importance sampling of many lights with adaptive tree splitting , 2017, SIGGRAPH Talks.

[26]  Jimmy Ba,et al.  Adam: A Method for Stochastic Optimization , 2014, ICLR.

[27]  Nathaniel L. Jones Validated interactive daylighting analysis for architectural design , 2017 .

[28]  Steve Marschner,et al.  Microfacet Models for Refraction through Rough Surfaces , 2007, Rendering Techniques.

[29]  Leonidas J. Guibas,et al.  Optimally combining sampling techniques for Monte Carlo rendering , 1995, SIGGRAPH.

[30]  Michael J. Black,et al.  OpenDR: An Approximate Differentiable Renderer , 2014, ECCV.

[31]  Adam Arbree,et al.  To appear in the ACM SIGGRAPH conference proceedings Lightcuts: A Scalable Approach to Illumination , 2022 .

[32]  Andrew Zisserman,et al.  Very Deep Convolutional Networks for Large-Scale Image Recognition , 2014, ICLR.

[33]  Aaron Hertzmann,et al.  Introduction to 3D Non-Photorealistic Rendering: Silhouettes and Outlines , 1999 .

[34]  Michael J. Jones,et al.  Model-Based Matching by Linear Combinations of Prototypes , 1996 .

[35]  Luca Antiga,et al.  Automatic differentiation in PyTorch , 2017 .

[36]  Jonathon Shlens,et al.  Explaining and Harnessing Adversarial Examples , 2014, ICLR.

[37]  Bruce G. Baumgart,et al.  Geometric modeling for computer vision. , 1974 .

[38]  Yves D. Willems,et al.  Path Differentials and Applications , 2001, Rendering Techniques.

[39]  Anat Levin,et al.  An Evaluation of Computational Imaging Techniques for Heterogeneous Inverse Scattering , 2016, ECCV.

[40]  Paul S. Heckbert,et al.  Irradiance gradients , 2008, SIGGRAPH '08.

[41]  Sumanta N. Pattanaik,et al.  Radiance caching for efficient global illumination computation , 2008, IEEE Transactions on Visualization and Computer Graphics.

[42]  Matan Sela,et al.  Learning Detailed Face Reconstruction from a Single Image , 2016, 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).

[43]  Joan Bruna,et al.  Intriguing properties of neural networks , 2013, ICLR.

[44]  Jaakko Lehtinen,et al.  Two-shot SVBRDF capture for stationary materials , 2015, ACM Trans. Graph..

[45]  Anton Kaplanyan,et al.  The natural-constraint representation of the path space for efficient light transport simulation , 2014, ACM Trans. Graph..

[46]  Steve Marschner,et al.  Matching Real Fabrics with Micro-Appearance Models , 2015, ACM Trans. Graph..

[47]  Jitendra Malik,et al.  Shape, Illumination, and Reflectance from Shading , 2015, IEEE Transactions on Pattern Analysis and Machine Intelligence.

[48]  Pedro V. Sander,et al.  Silhouette clipping , 2000, SIGGRAPH.

[49]  Leonidas J. Guibas,et al.  Metropolis light transport , 1997, SIGGRAPH.

[50]  Steve Marschner,et al.  Discrete stochastic microfacet models , 2014, ACM Trans. Graph..

[51]  Brent Burley Physically-Based Shading at Disney , 2012 .

[52]  Ingo Wald,et al.  Embree: a kernel framework for efficient CPU ray tracing , 2014, ACM Trans. Graph..

[53]  Adrien Bousseau,et al.  Optimizing Environment Maps for Material Depiction , 2011, EGSR '11.

[54]  Andreas Griewank,et al.  Evaluating derivatives - principles and techniques of algorithmic differentiation, Second Edition , 2000, Frontiers in applied mathematics.

[55]  James T. Kajiya,et al.  The rendering equation , 1986, SIGGRAPH.

[56]  DurandFrédo,et al.  Differentiable Monte Carlo ray tracing through edge sampling , 2018 .

[57]  Homan Igehy,et al.  Tracing ray differentials , 1999, SIGGRAPH.

[58]  Adam Arbree,et al.  Multidimensional lightcuts , 2006, ACM Trans. Graph..