Soft Rasterizer: A Differentiable Renderer for Image-Based 3D Reasoning

Shichen Liu, Weikai Chen, Tianye Li, Hao Li

Abstract

Soft Rasterizer (SoftRas) is a truly differentiable rendering framework that bridges the gap between 2D images and 3D geometry. By replacing the discrete, non-differentiable steps of traditional rendering with a probabilistic "soft" formulation, it enables gradients to flow from image pixels back to 3D mesh vertices. This allows for high-quality 3D reconstruction and pose estimation using only 2D image supervision.

The Differentiability Gap in Rendering

In computer graphics, rasterization is the process of converting a 3D mesh into a 2D grid of pixels. Traditionally, this involves two discrete "all-or-nothing" decisions: sampling (determining if a pixel is inside a triangle) and Z-buffering (determining which triangle is closest to the camera).

Because these are discrete operations, their derivatives are zero almost everywhere, creating a "broken bridge" for deep learning. If a neural network generates a 3D model, traditional renderers cannot pass the error gradient from the 2D output back to the 3D shape parameters. Existing differentiable renderers often relied on hand-crafted gradients for the backward pass while keeping the forward pass discrete, leading to poor convergence and local minima.

The Soft Rasterizer Framework

SoftRas addresses this by viewing rendering as a probabilistic aggregation function. Instead of a pixel belonging to exactly one triangle, every triangle in the mesh contributes to every pixel's color based on its proximity and depth.

Comparison between the Soft Rasterizer pipeline, which uses probability maps, and the standard discrete rasterizer.

1. Probability Map Computation

For every triangle $f_j$ and pixel $p_i$, the renderer computes a probability $D_{i,j}$ that the pixel is covered. This is calculated using a sigmoid function based on the distance from the pixel to the triangle's edge. A sharpness parameter, $\sigma$, controls the "blurriness" of the triangle edges.

2. Differentiable Aggregation

To determine the final pixel color, SoftRas fuses the contributions of all triangles using a softmax-like function. This function considers both the probability map and the relative depth ($z$) of the triangles. A transparency parameter, $\gamma$, controls the influence of occluded triangles, ensuring that gradients can flow even to hidden parts of the mesh.

Smoothing the Optimization Landscape

One of the key advantages of SoftRas is the ability to "soften" the optimization problem. By starting with high values for $\sigma$ (blurry) and $\gamma$ (transparent) and gradually reducing them, the system can avoid local minima and converge to a global optimum. This global gradient flow allows pixels to provide feedback to distant triangles, helping the model recover from poor initializations.

Visualizing the effect of hyperparameters on rendering and the resulting 3D reconstructions for cars and textured objects.

Key Results and Performance

The framework was evaluated primarily on the ShapeNet dataset across 13 object categories. SoftRas achieved a mean Intersection over Union (mIoU) of 64.6, significantly outperforming the previous state-of-the-art Neural Mesh Renderer (NMR), which scored 60.1.

Qualitatively, SoftRas produces meshes with much finer details, such as thin chair legs and airplane engines, with fewer self-intersections. Furthermore, the paper demonstrates successful pose fitting for complex models like the SMPL human model, even when parts are initially occluded—a scenario where discrete renderers typically fail.

Conclusion and Future Work

Soft Rasterizer provides a robust, mathematically sound bridge between the 2D and 3D domains. While the "soft" approach is more computationally intensive than standard rasterization due to the global influence of triangles, it enables a new class of unsupervised 3D reasoning. Future work involves scaling the method to higher resolutions and exploring more complex aggregation functions to improve physical realism.

Summary updated

BibTeX
@inproceedings{liu2019soft,
  author = {Shichen Liu and Weikai Chen and Tianye Li and Hao Li},
  title = {{Soft Rasterizer: A Differentiable Renderer for Image-Based 3D Reasoning}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  doi = {10.1109/iccv.2019.00780},
}
Figure