Abstract
Differentiable rendering is a cornerstone of modern inverse graphics, yet researchers often face a trade-off between the speed of rasterizers and the physical accuracy of path tracers. This paper introduces a method to bridge this gap by making shadow mapping differentiable. By utilizing Variance Shadow Maps (VSM) and pre-filtering techniques, the authors transform binary shadow visibility into a continuous, differentiable function. This approach enables efficient gradient-based optimization for tasks like pose estimation and 3D reconstruction, achieving speeds up to 27x faster than traditional path-tracing methods while maintaining high accuracy.
Introduction
In inverse graphics, the goal is to estimate scene parameters—such as geometry, lighting, or pose—directly from 2D images. Standard differentiable rasterizers are highly efficient but often omit shadows, leading to "flat" renders that lack crucial depth cues. Without shadows, optimization algorithms frequently struggle to resolve ambiguities in object orientation and distance. Conversely, path tracers provide realistic shadows but are computationally intensive and noisy, hindering the iterative loops required for machine learning.
This paper addresses the "shadow gap" by adapting real-time shadow mapping techniques into a differentiable framework, allowing for fast, shadow-aware optimization that provides a "second view" of objects from the light's perspective.
Methodology
The core innovation lies in making the shadow visibility test differentiable. Standard shadow mapping uses a binary depth comparison, which has zero derivatives almost everywhere and is unsuitable for gradient descent.
- Variance Shadow Maps (VSM): The authors treat shadow visibility as a probability distribution. By storing mean depth and depth-squared in the shadow map, they apply Chebyshev’s inequality to derive a smooth, continuous visibility function.
- Differentiable Rasterization: Using
NVDiffRast, the scene is rendered from the light's perspective. This allows the computation of gradients for shadow map moments with respect to scene parameters like object position or light direction. - Pre-filtering: Smoothing kernels are applied to the shadow map to ensure boundaries provide useful gradient information, effectively "pulling" geometry into alignment with target shadows during optimization.
Results and Applications
The method was evaluated across several benchmarks, including pose estimation for standard 3D meshes (e.g., the Stanford Bunny and "Spot" the cow), 3D face reconstruction from silhouettes, and the creation of "Shadow Art" where geometry is optimized to cast specific complex shapes.
Key findings include:
- Efficiency: The proposed rasterizer is approximately 27x faster than the state-of-the-art Mitsuba 3 path tracer on an NVIDIA RTX 3080 Ti.
- Convergence: In tasks where shadowless rasterization fails to converge due to local minima, the addition of differentiable shadows consistently leads the optimizer to the correct global solution.
- Interactive Tools: The speed of the method enables real-time "shadow modeling," where users can manipulate 3D geometry by painting desired shadows on a surface.
Discussion and Limitations
While a significant step forward, the method inherits some limitations from VSM, such as "light bleeding" in complex geometries where shadows become unnaturally light. Additionally, the current implementation is restricted to point and directional lights, omitting the soft shadows of area lights or complex global illumination effects like indirect bounces. Future work may explore similar "proxy" techniques to bring these more complex light behaviors into the differentiable rendering fold.
Summary updated