﻿# Mitsuba shape gradients: choose an estimator that accounts for changing visibility

Choose a Mitsuba derivative integrator for geometry optimization by distinguishing ordinary PRB from projective sampling of visibility-boundary contributions.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-mitsuba-geometry-visibility-derivative-estimator/
Language: en

## Start with the scene change

Moving an object can reveal a light source, shift a silhouette or change a shadow. Those effects alter which light paths contribute to an image. A derivative computed only along the previously visible paths can miss an important part of that change. Define whether the optimization varies radiometric properties or scene geometry before choosing the rendering derivative method and interpreting the resulting gradient.

## Read the integrator's geometric limitations

The [Mitsuba integrator reference](https://mitsuba.readthedocs.io/en/latest/src/generated/plugins_integrators.html) explicitly states that ordinary `prb` lacks projective sampling and returns incorrect or biased gradients for geometric parameters such as vertex positions. An AD-enabled rendering variant establishes differentiation capability, but the selected integrator still determines the estimator used. Merely enabling gradients on a vertex array does not remove the integrator's documented boundary.

## Include visibility-boundary contributions

The [projective sampling research](https://rgl.epfl.ch/publications/Zhang2023Projective) addresses discontinuous visibility changes by treating the relevant boundary contribution explicitly. Its projected samples help construct a guiding distribution for difficult derivative integration. In an application, match the supported estimator to the kind of scene change and the active renderer release. Avoid treating a plausible gradient image as an independent guarantee that every required derivative term has been included.

## Allocate derivative samples to the intended effect

The [Mitsuba tutorial](https://mitsuba.readthedocs.io/en/latest/src/inverse_rendering/projective_sampling_integrators.html) separates continuous derivatives, primary visibility and indirect visibility, with corresponding sampling controls. A shadow-only observation can emphasize a different contribution from a directly observed moving contour. Read the effective sampling configuration, including overrides from the render call, before attributing a noisy or missing signal to the optimizer. Preserve the integrator and its controls alongside the optimization result.

## Validate a small geometry problem

Choose a simple scene where a controlled displacement visibly moves a contour or shadow. Compare the derivative estimate with carefully configured finite differences across several sampling realizations, recognizing the noise and step-size sensitivity of that comparison. The guides to [autograd graphs](/journal/autograd-chain-rule-neural-graphs/) and [GPU BVH traversal](/journal/learn-gpu-bvh-traversal/) describe related mechanisms. Here the question is whether the rendering estimator represents the image change caused by visibility, before a learning algorithm follows its direction.
