---
title: Differentiable Voronoi Ray Tracing
url: https://www.emergentmind.com/topics/differentiable-voronoi-ray-tracing
type: topic
---

# Differentiable Voronoi Ray Tracing

Differentiable Voronoi ray tracing is a class of ray-based rendering methods in which space, a surface parameter domain, or a light-transport domain is partitioned into regions associated with nearest sites, and rendering is differentiated with respect to both the smooth quantities within each region and the moving boundaries between regions. Its defining difficulty is that nearest-site ownership, ray–cell traversal, visibility, and first-hit selection are discrete operations. Ordinary automatic differentiation differentiates only the currently active branch; a complete derivative must additionally account for boundary motion, changes in cell assignment, and topology events. Recent work spans three complementary approaches: explicit boundary-integral estimators for discontinuous rendering, piecewise-differentiable Voronoi geometry, and differentiable volumetric rendering through Voronoi-cell traversal, including real-time implementations such as Radiant Foam and VoroTracing [1904.12228] [2312.16192] [2502.01157] [2608.17682].

## 1. Mathematical formulation and derivative structure

Let sites depend on scene parameters $\Phi$ and define a Voronoi partition

$$
V_i(\Phi)=\{x:d_i(x;\Phi)\leq d_j(x;\Phi)\ \forall j\}.
$$

For Euclidean distance, $d_i(x;\Phi)=\|x-s_i(\Phi)\|$. A rendered quantity integrated over a domain $D$ can be expressed as

$$
I(\Phi)=\sum_i\int_{D\cap V_i(\Phi)} f_i(x;\Phi)\,dx,
$$

where $f_i$ is smooth while the active site remains fixed. Between sites $i$ and $j$, the cell boundary is defined implicitly by

$$
\alpha_{ij}(x;\Phi)=d_i(x;\Phi)-d_j(x;\Phi)=0.
$$

For squared Euclidean distance,

$$
\alpha_{ij}(x)=\|x-s_i\|^2-\|x-s_j\|^2,
$$

which expands to

$$
\alpha_{ij}(x)
=
2x\cdot(s_j-s_i)+\|s_i\|^2-\|s_j\|^2.
$$

Consequently, the bisector is planar and

$$
\nabla_x\alpha_{ij}=2(s_j-s_i).
$$

The derivative of the integral has two components:

$$
\begin{aligned}
\nabla_\Phi I
={}&
\sum_i\int_{D\cap V_i(\Phi)}
\nabla_\Phi f_i(x;\Phi)\,dx\\
&+
\sum_{(i,j)}
\int_{\alpha_{ij}=0}
\frac{\nabla_\Phi\alpha_{ij}(x;\Phi)}
{\|\nabla_x\alpha_{ij}(x;\Phi)\|}
\left(f_i(x;\Phi)-f_j(x;\Phi)\right)
\,d\sigma(x).
\end{aligned}
$$

The first term is the smooth or interior derivative. It includes shading, radiance, materials, ray directions, textures, and other computations performed without changing nearest-site ownership. The second is the boundary term. It accounts for the motion of the Voronoi boundary and the jump in rendered contribution between neighboring cells.

This decomposition is the Voronoi analogue of the Heaviside/Dirac formulation used for visibility discontinuities in differentiable Monte Carlo ray tracing. A piecewise rendering function can be written locally as

$$
\theta(\alpha_{ij})f_i+\theta(-\alpha_{ij})f_j,
$$

where $\theta$ is the Heaviside function. Differentiating $\theta$ produces a Dirac delta,

$$
\frac{d\theta(\alpha)}{d\Phi}
=
\delta(\alpha)\frac{\partial\alpha}{\partial\Phi},
$$

which converts to a boundary integral. The same principle is equivalently expressed by Reynolds transport theorem: differentiating an integral over a moving cell yields an interior term plus a boundary flux term proportional to boundary velocity and the jump between neighboring-cell integrands [1904.12228].

If $f_i=f_j$ on a common boundary, the boundary contribution vanishes even when the nearest-site assignment changes. If the sites produce different radiance, materials, densities, or geometric responses, the jump is nonzero and the boundary term must be represented.

## 2. Ray traversal through Voronoi cells

A ray is written as

$$
r(t)=o+t\omega,
$$

where $o$ is the origin and $\omega$ is a unit direction. Once the ray is inside the cell associated with site $p_i$, only neighboring cells need to be examined. For a neighboring site $p_j$, the shared bisector plane is

$$
2(p_j-p_i)^\top x
=
\|p_j\|^2-\|p_i\|^2.
$$

Substitution of the ray equation gives the intersection parameter

$$
t_{ij}
=
\frac{
\frac{1}{2}\left(\|p_j\|^2-\|p_i\|^2\right)
-(p_j-p_i)^\top o
}{
(p_j-p_i)^\top\omega
},
$$

provided the denominator is nonzero. The next cell is selected by the smallest valid forward intersection among the current cell’s neighbors:

$$
j^\star
=
\arg\min_{j\in\mathcal N(i)}
\{t_{ij}:t_{ij}>t_{\mathrm{current}}\}.
$$

If consecutive boundary intersections occur at $t_k$ and $t_{k+1}$, the segment length within the current cell is

$$
\delta_k=t_{k+1}-t_k.
$$

The traversal algorithm therefore consists of an initial nearest-site query followed by local face tests:

1. identify the initial cell;
2. enumerate its Delaunay-derived neighboring cells;
3. intersect the ray with candidate bisector planes;
4. reject invalid or non-forward intersections;
5. select the first valid exit;
6. integrate the current cell over the resulting interval;
7. move to the neighboring cell;
8. repeat until the ray exits the domain or transmittance becomes sufficiently small.

The computational advantage is locality: after initialization, traversal cost is governed primarily by the number of cells crossed and the degree of the visited cells rather than directly by the total number of sites. For a cell with $k_i$ neighbors, the local exit operation costs $O(k_i)$. A ray crossing $N_r$ cells has approximate traversal cost

$$
O\left(\sum_{n=1}^{N_r}k_{i_n}\right),
$$

which is effectively $O(N_r)$ for bounded-degree meshes.

This traversal is implemented directly in “Radiant Foam: Real-Time Differentiable Ray Tracing,” which uses a 3D Voronoi tessellation as the rendered volumetric partition and a Delaunay structure as its dual adjacency representation [2502.01157]. “Differentiable Voronoi Ray Tracing Beyond Rasterization Speeds” develops the same principle into VoroTracing, emphasizing reduced traversal length, per-cell work, memory locality, and coherent GPU execution [2608.17682].

## 3. Differentiable volume rendering

In Voronoi volumetric rendering, density and radiance are constant within each cell or are evaluated from cell-associated appearance parameters. For a segment of length $\delta_k$ in cell $i_k$, opacity is

$$
\alpha_k=1-\exp(-\sigma_{i_k}\delta_k).
$$

The transmittance before the segment is

$$
T_k=\prod_{j<k}(1-\alpha_j),
$$

and its compositing weight is

$$
w_k=T_k\alpha_k.
$$

The rendered color is

$$
\mathbf C(r)
=
\sum_k T_k\alpha_k
\mathbf c_{i_k}(x_k,\omega),
$$

where $x_k$ is a representative point and $\mathbf c_{i_k}$ is the cell radiance. The recurrence is

$$
T_{k+1}=T_k(1-\alpha_k),
\qquad
T_1=1.
$$

For piecewise-constant density and radiance, the cellwise sum is the exact integral of the chosen representation rather than a numerical approximation obtained by sampling arbitrary points along the ray. Gradients propagate through density, segment lengths, alpha, transmittance, cell radiance, ray origins, ray directions, and site positions.

The opacity derivatives are

$$
\frac{\partial\alpha_k}{\partial\sigma_{i_k}}
=
\delta_k(1-\alpha_k),
$$

and

$$
\frac{\partial\alpha_k}{\partial\delta_k}
=
\sigma_{i_k}(1-\alpha_k).
$$

Because $\delta_k$ depends on bisector intersections, site-position gradients reach the rendered image through the moving Voronoi geometry. A site displacement changes cell boundaries, ray exit times, segment lengths, surface-direction parameters, texture coordinates, and compositing weights.

Radiant Foam parameterizes density using a softplus activation with $\beta=10$ and represents view-dependent color with degree-three spherical harmonics. VoroTracing instead optimizes an unconstrained density parameter $\rho_i$ using

$$
\sigma_i=\exp(\rho_i).
$$

Since

$$
\frac{\partial\sigma_i}{\partial\rho_i}=\sigma_i,
$$

the density gradient becomes

$$
\frac{\partial L}{\partial\rho_i}
=
\frac{\partial L}{\partial\alpha_i}
(1-\alpha_i)
\ln\frac{1}{1-\alpha_i}.
$$

The segment length cancels, making the density optimization scale-invariant with respect to cell size. In the reported ablation, exponential density improved average PSNR from $27.90$ to $28.18$ dB, reduced cells per ray from $59.6$ to $51.7$, and increased speed from $430$ to $496$ FPS [2608.17682].

VoroTracing uses two $8\times8$ RGB octahedral textures per cell: a view-independent surface texture and a view-dependent residual. Given a direction $\mathbf d$ from the site to a cell-boundary point,

$$
\mathbf q
=
\frac{\mathbf d}{|d_x|+|d_y|+|d_z|},
$$

and the direction is unfolded onto a square through octahedral mapping. The final color is obtained by applying a componentwise sigmoid to the sum of the surface-dependent and view-dependent texture lookups. Bilinear interpolation distributes gradients to the four neighboring texels of each map.

The representation contrasts with spherical harmonics. Degree-three spherical harmonics require $48$ RGB coefficient values per cell, whereas two bilinear octahedral lookups load $24$ values in the nominal case. The textures also encode spatial variation across a cell’s surface footprint, allowing larger cells to carry more appearance detail without necessarily increasing traversal depth.

## 4. Voronoi construction, autodifferentiation, and topology

A differentiable 2D Voronoi construction can be obtained by treating the Delaunay triangulation as discrete external information and differentiating the resulting geometric operations. For a Delaunay triangle with sites $a$, $b$, and $c$, the corresponding Voronoi vertex is the circumcenter. Its coordinates are rational functions of the site coordinates, with denominator

$$
D
=
2\left[
(a_1-c_1)(b_2-c_2)
-
(b_1-c_1)(a_2-c_2)
\right].
$$

The circumcenter is differentiable wherever $D\neq0$. Each interior Delaunay edge corresponds to a Voronoi edge joining the circumcenters of its two incident triangles. A Voronoi cell is formed by ordering the circumcenters and, for unbounded cells, adding differentiable ghost points. Cell areas can be computed with the Shoelace formula, and bounded diagrams can be produced by differentiable polygon clipping [2312.16192].

The resulting computational structure is piecewise differentiable:

$$
\text{sites}
\longrightarrow
\text{fixed Delaunay adjacency}
\longrightarrow
\text{circumcenters}
\longrightarrow
\text{Voronoi edges and cells}
\longrightarrow
\text{ray intersections}
\longrightarrow
\text{rendering loss}.
$$

The Delaunay triangulation itself is not included in the autodiff graph. It is recomputed periodically or updated incrementally, while gradients are propagated through the current geometric graph. This supplies local derivatives for fixed topology but not derivatives through Delaunay flips, cocircular configurations, or changes in which cells are unbounded.

Radiant Foam likewise maintains Delaunay-derived adjacency while rendering Voronoi cells. Its argument is that a Voronoi face disappears with zero area during an adjacency transition, so the piecewise-constant volumetric field and ray-segment lengths remain continuous under ordinary site motion except at degenerate configurations. The exact derivative at the topology event is nevertheless not generally defined [2502.01157].

Important degeneracies include nearly collinear or coplanar site configurations, coincident sites, zero-area Voronoi faces, multiple-site ties, ray–face parallelism, changes in the first intersected face, and simultaneous boundary events. Circumcenter derivatives become ill-conditioned when $D$ approaches zero. The hard minimum selecting the next face and the hard argmin selecting the nearest site are nondifferentiable at ties. A piecewise-autodiff implementation can accept these events as measure-zero configurations, but numerical robustness may require explicit degeneracy detection, stable predicates, regularization, symbolic perturbation, or event-aware graph rebuilding.

## 5. Boundary-aware and softened differentiation

The piecewise-differentiable Voronoi traversal used by Radiant Foam and VoroTracing differentiates ray–bisector intersections conditional on a fixed cell adjacency and active face. It does not, by itself, provide a globally smooth derivative through every change in cell identity. Two broad strategies address this limitation.

### Boundary-integral estimators

The boundary-integral approach explicitly samples moving discontinuities. For an edge or boundary $E$, a Monte Carlo estimator has the form

$$
\frac{1}{N}
\sum_{j=1}^{N}
\frac{
\|E\|\,
\nabla\alpha_i(x_j,y_j)\,
\left(f_u(x_j,y_j)-f_l(x_j,y_j)\right)
}{
P(E)\,
\|\nabla_{x_j,y_j}\alpha_i(x_j,y_j)\|
}.
$$

The two-sided contributions are evaluated from slightly offset samples on either side of the boundary, typically with an offset of approximately $10^{-6}$ and a shared random-number sequence. This correlated sampling reduces variance. The method is not finite differencing: the scene parameters are not perturbed and rerendered; instead, the jump in contribution across a fixed geometric boundary is estimated directly.

For Voronoi ray tracing, triangle edges are replaced by active bisectors or higher-dimensional assignment boundaries. Candidate neighboring site pairs must be enumerated efficiently, and the boundary measure and Jacobian must be adapted to the selected metric. In screen space, a boundary is generally a curve; in ray space, it may be a hypersurface. The boundary contribution is proportional to the jump in complete rendered or transport contribution, not merely to the difference in site labels.

### Soft partitions and continuation

A hard nearest-site assignment can be replaced by soft weights,

$$
w_i(x)
=
\frac{\exp[-\beta d_i(x)]}
{\sum_j\exp[-\beta d_j(x)]},
$$

or by a soft minimum,

$$
\operatorname{softmin}_\beta(d_1,\ldots,d_M)
=
-\frac{1}{\beta}
\log\sum_m e^{-\beta d_m}.
$$

Soft assignments provide gradients across cell boundaries but modify the exact Voronoi model near those boundaries. The same trade-off appears in differentiable optical and radio ray tracing. Algorithmic differentiable non-sequential ray tracing uses automatic differentiation through ray states, refraction, detector intersections, and smooth reconstruction filters, while leaving discrete intersection and branch decisions only partially treated [2302.12031]. Differentiable radio ray tracing differentiates physical field computation along fixed paths but does not differentiate path generation, visibility, geometry, or path topology [2311.18558].

RayLoc addresses sparse gradients and local minima by convolving its localization loss with a Gaussian over candidate positions and using coarse-to-fine variance decay. Without Gaussian smoothing, the device-free median error exceeds $1.75$ m, compared with approximately $0.67$ m for RayLoc. This strategy is relevant as a continuation method for Voronoi ownership and boundary events, but it is an optimization approximation rather than an exact boundary derivative [2501.17881].

## 6. Systems, applications, and performance

Voronoi ray tracing has applications in differentiable novel-view synthesis, inverse rendering, optical design, radio-environment calibration, radiative transfer, and scene localization. The physical quantities that can be differentiated depend on the renderer. They may include site positions, camera parameters, ray origins and directions, densities, radiance textures, material properties, antenna patterns, propagation delays, reflection and diffraction coefficients, and task-specific losses.

For physically based rendering, the full differentiable pipeline separates smooth path derivatives from visibility or ownership derivatives. The general-purpose differentiable ray tracer in “Differentiable Visual Computing” supports camera pose, mesh geometry, lights, materials, textures, and arbitrary light-transport parameters, with a reported overhead of approximately $10\times$–$20\times$ over rendering an image alone. Its experiments report agreement with central finite differences within $1\%$ relative to the $L^1$ norm at $32\times32$ resolution and demonstrate optimization involving primary visibility, shadows, glossy reflection, global illumination, and camera parameters [1904.12228].

For volumetric Voronoi rendering, Radiant Foam reports $200$ FPS on Mip-NeRF 360 and $301$ FPS on Deep Blending, with average values of $28.47$ PSNR, $0.83$ SSIM, and $0.21$ LPIPS on Mip-NeRF 360. Its core engineering choices are local convex-cell traversal, exact piecewise-constant volume compositing, GPU execution without RT cores or OptiX, and Delaunay-derived adjacency [2502.01157].

VoroTracing co-designs representation and execution. It concentrates opacity near surfaces, uses exponential density, employs compact octahedral textures, avoids pruning and densification with a fixed budget of $2$ million sites, and applies Morton ordering, $4\times8$ warp-coherent ray tiles, aligned four-channel texture loads, half-precision attributes, and low-contribution cell skipping. On Mip-NeRF 360, it reports $623$ FPS on an RTX 5090, compared with $194$ FPS for Radiant Foam, $131$ FPS for ray-traced PowerFoam, and $220$ FPS for 3D Gaussian Splatting. Its average quality is $28.98$ PSNR, $0.848$ SSIM, and $0.235$ LPIPS. The reported average traversal length is $46.1$ cells per ray, compared with $66.9$ for Radiant Foam [2608.17682].

Its ray formulation naturally supports non-pinhole effects by changing ray generation rather than redesigning a rasterizer. Fisheye projection, rolling shutter, motion blur, and depth of field can be expressed through altered ray origins, directions, camera poses, or multisampling. The reported $623$ FPS applies to standard pinhole rendering; multisampled effects reduce frame rate in proportion to the number of rays per pixel.

A complete differentiable Voronoi ray tracer must nevertheless address several unresolved or conditionally solved issues:

- **Nearest-site ownership**: hard argmin operations are differentiable only away from ties.
- **First-face selection**: the minimum over candidate intersections changes discontinuously when two faces exchange order.
- **Topology changes**: Delaunay flips and Voronoi adjacency changes require graph updates and do not receive ordinary reverse-mode derivatives.
- **Degeneracy**: coincident sites, zero-area faces, nearly singular circumcenters, and parallel ray–face configurations can produce unstable Jacobians.
- **Visibility and path birth/death**: exact geometric events require boundary-integral estimators, soft visibility, or other measure-aware treatments.
- **Dynamic structure**: pruning, densification, site insertion, and deletion introduce discrete or trans-dimensional changes beyond ordinary continuous differentiation.
- **Physical interfaces**: reflection, refraction, scattering, and global illumination require additional interface normals, material models, and secondary-ray estimators.

Ray-trax illustrates a related GPU architecture based on vectorized rays, fixed-size loops, JAX compilation, multi-GPU sharding, and differentiable emission–absorption updates, but it operates on a regular Cartesian grid with fixed spatial steps rather than Voronoi cells [2511.09389]. Power Foam extends foam-based ray tracing toward bounded power diagrams and oriented surface formulations, but the supplied source does not provide technical details sufficient to establish its algorithm or results [2604.24994].

The central methodological distinction is therefore between differentiating a smooth rendering computation conditional on a fixed spatial partition and differentiating the partition itself. Voronoi ray tracing provides explicit cell geometry, local traversal, and differentiable segment lengths; boundary-aware methods provide the missing contribution when ownership changes alter the integrated rendering function. A system that combines both—piecewise autodiff for fixed topology, explicit bisector derivatives for moving boundaries, and robust treatment of topology and visibility events—constitutes the technically complete form of differentiable Voronoi ray tracing.

Source: https://www.emergentmind.com/topics/differentiable-voronoi-ray-tracing