---
title: Differentiable 2D Gaussian Ray Tracing
url: https://www.emergentmind.com/topics/differentiable-2d-gaussian-ray-tracing
type: topic
---

# Differentiable 2D Gaussian Ray Tracing

Differentiable 2D Gaussian ray tracing denotes a class of Gaussian rendering methods in which rays are traced against disk-like 2D Gaussian primitives in 3D, the resulting interactions are accumulated in front-to-back order, and the entire process remains differentiable with respect to geometric and radiometric or sensor-response parameters. In contrast to conventional 3D Gaussian splatting, which is centered on projecting Gaussians into screen space and rasterizing them, this formulation is explicitly ray-centric: it uses BVH-accelerated traversal, ray–primitive intersection, and transmittance or alpha-compositing along the ray. In late-2024 work, the formulation appears in two distinct but closely related settings: dynamic LiDAR re-simulation in LiDAR-RT [2412.15199] and inverse rendering with inter-reflection in IRGS [2412.15867].

## 1. Conceptual lineage and relation to Gaussian rendering

Gaussian reconstruction kernels were proposed by Westover (1990) and were studied by the computer graphics community in the 1990s as an alternative geometric representation to meshes and point clouds. A modern differentiable rendering precursor is VoGE, which uses explicit 3D Gaussian ellipsoids and renders them by tracing rays through volumetric density, rather than by rasterizing triangles or points [2205.15401]. In VoGE, each ellipsoidal Gaussian induces a 1D Gaussian along a ray, and the renderer approximates the contribution of primitive \(k\) as
\[
W_{p,k}=T(l_k)e^{q_k}, \qquad C(\mathbf{r})\approx \sum_{k=1}^K W_{p,k}\mathbf{c}_k,
\]
with transmittance expressed in closed form through the error function. This established a ray-traced, transmittance-based alternative to rasterization for Gaussian primitives.

Differentiable 2D Gaussian ray tracing departs from that volumetric 3D-Gaussian view in a specific way. A common misconception is to treat “2D Gaussian” as referring only to projected screen-space Gaussians used during rasterization. In the relevant late-2024 formulations, the term also refers to a surface-like primitive in 3D: LiDAR-RT treats 2D Gaussians as planar disks for ray tracing, and IRGS defines each 2D Gaussian as a disk-like element with a supporting plane and an analytic ray–splat intersection [2412.15199]. IRGS makes the motivation explicit: 3DGS is rasterization-centric, the rendering equation requires visibility and indirect radiance along arbitrary incident directions, and direct ray tracing of pretrained 3D Gaussian primitives is not ideal because the ray–splat intersection is ambiguous and can cause noticeable rendering degradation [2412.15867].

This shift is significant because it changes the role of Gaussians from purely image-plane splats to explicit ray-interaction primitives. LiDAR-RT further argues that rasterization is ill-suited for the cylindrical LiDAR range image and for LiDAR’s active sensing process, so ray tracing is adopted as the physically accurate core [2412.15199].

## 2. Primitive parameterization and geometric proxies

IRGS parameterizes each 2D Gaussian by a center \(\boldsymbol{\mu}\in\mathbb{R}^3\), opacity \(o\in[0,1]\), two tangent vectors \(\boldsymbol{t_u},\boldsymbol{t_v}\in\mathbb{R}^3\), and a scaling vector \(\boldsymbol{s}=(s_u,s_v)\in\mathbb{R}^2\) [2412.15867]. These parameters define an oriented disk-like primitive in 3D. The associated normal is \(\boldsymbol{n}=\boldsymbol{t_u}\times \boldsymbol{t_v}\), which gives the primitive a well-defined supporting plane.

LiDAR-RT begins from the standard 3D Gaussian splatting primitive
\[
\mathcal{G}_{i}(\mathbf{x}) = \exp\left(-\frac{1}{2}(\mathbf{x}-\mu_i)^\top \Sigma_i^{-1}(\mathbf{x}-\mu_i)\right),
\qquad
\Sigma_i = R_i S_i S_i^\top R_i^\top,
\]
with mean position \(\mu_i\), covariance \(\Sigma_i\), opacity \(\sigma_i\), and spherical harmonics coefficients \(c_i\). It then extends each Gaussian with LiDAR-specific learnable attributes \(\mathcal{P}=(\zeta,\beta)\), where \(\zeta\in\mathbb{R}\) is reflection intensity and \(\beta\in[0,1]\) is ray-drop probability; both are modeled with spherical harmonics because intensity and drop probability depend on viewing direction [2412.15199].

Efficient ray tracing requires proxy geometry. LiDAR-RT does not intersect rays against full analytic Gaussian volumes directly. Instead, it prefers 2D Gaussians as the ray-traced primitive, treats them as planar disks, and uses a pair of co-planar triangles as the simplest proxy geometry for BVH construction and intersection testing. The paper states that this is the most efficient option, because it reduces mesh complexity, tightly wraps the Gaussian, avoids the “maximum response” approximation used in some particle ray tracing methods, and makes the ray intersection sample locations coincide with actual ray hits [2412.15199].

IRGS adopts a different proxy strategy. Each 2D Gaussian is enclosed by an adaptive icosahedron mesh sized to cover the primitive’s influence down to a minimum opacity threshold \(\alpha_\mathrm{min}\):
\[
\boldsymbol{v} \gets \sqrt{2 \log(o / \alpha_\mathrm{min})}
\begin{pmatrix}
s_u \boldsymbol{t_u} & s_v \boldsymbol{t_v} & \epsilon\mathbf{1}
\end{pmatrix}
\boldsymbol{v} + \boldsymbol{\mu}.
\]
Each icosahedron has 20 triangular faces, so a scene with \(N\) Gaussians yields \(20N\) triangles before BVH construction [2412.15867].

The coexistence of triangle-pair and icosahedral proxies indicates that differentiable 2D Gaussian ray tracing is not tied to a single geometric surrogate. What is shared is the use of compact bounding geometry to enable hardware-accelerated ray traversal over surface-like Gaussian elements.

## 3. Ray traversal, ordering, and intersection evaluation

In LiDAR-RT, rays are batched as
\[
\mathcal{R}=\{\mathbf{r}_o,\mathbf{r}_d\},
\]
where \(\mathbf{r}_o\in\mathbb{R}^{N_r\times 3}\) are ray origins and \(\mathbf{r}_d\in\mathbb{R}^{N_r\times 3}\) are normalized ray directions. Ray generation is launched through NVIDIA OptiX using `optixLaunch`. The ray-generation program casts the rays against the BVH, the any-hit program records intersections, and a sorted buffer maintains the front-to-back order of intersections. To avoid the cost of storing and sorting all hits globally, intersections are processed in chunks; the paper uses chunk size 16. When a chunk fills, the renderer extracts indices \(\mathcal{I}\) of intersected primitives and depth values \(\mathcal{D}\), evaluates Gaussian responses at the sample points, accumulates the LiDAR attributes front-to-back, and advances until all intersections have been processed or the transmittance drops below \(T_{\min}\) [2412.15199].

IRGS uses OptiX as well, but its emphasis is the exact ray–splat intersection for 2D Gaussians. Given ray origin \(\boldsymbol{r}_o\), direction \(\boldsymbol{r}_d\), Gaussian center \(\boldsymbol{\mu}\), and normal \(\boldsymbol{n}\), the intersection point is
\[
\boldsymbol{p} = \boldsymbol{r}_o + \tau \boldsymbol{r}_d,
\qquad
\tau = \frac{\boldsymbol{n}^\top(\boldsymbol{\mu} - \boldsymbol{r}_o)}{\boldsymbol{n}^\top\boldsymbol{r}_d}.
\]
The local coordinates in the Gaussian basis are
\[
u = \frac{1}{s_u} (\boldsymbol{p} - \boldsymbol{\mu})^\top \boldsymbol{t}_u,
\qquad
v = \frac{1}{s_v} (\boldsymbol{p} - \boldsymbol{\mu})^\top \boldsymbol{t}_v,
\]
and the Gaussian response at the hit point is
\[
G(\boldsymbol{p}) = \exp\left(-\frac{u^2 + v^2}{2}\right).
\]
A \(k\)-buffer per-ray sorting algorithm is then used to obtain the exact front-to-back ordering of intersected Gaussians along each ray [2412.15867].

These two formulations share a common operational structure: BVH traversal identifies candidate Gaussian proxies, per-ray ordering is established explicitly, and Gaussian responses are evaluated at ray-consistent sample points. The principal difference is task-driven. LiDAR-RT traces sensor rays to render range, intensity, and ray-drop; IRGS traces arbitrary incident-light rays to recover visibility and indirect radiance.

## 4. Accumulation, visibility, and differentiability

The accumulation model derives from the alpha-compositing structure used in Gaussian splatting preliminaries. For projected 2D Gaussians in screen space,
\[
\Sigma_i' = J W \Sigma_i W^\top J^\top,
\]
and the pixel value is
\[
\mathcal{C}(\mathbf{x}) = \sum_{i=1}^{K} T_i \alpha_i c_i,
\qquad
\alpha_i = \sigma_i \mathcal{G}'_i(\mathbf{x}),
\qquad
T_i = \prod_{j=1}^{i-1}(1-\alpha_j).
\]
LiDAR-RT reuses the same compositing idea, but the rendered attribute is not RGB. Instead, \(c_i\) is replaced by LiDAR-specific quantities such as intensity \(\zeta_i\) and ray-drop probability \(\beta_i\), while depth or range is accumulated along the same front-to-back traversal [2412.15199].

Its backward pass is organized to match the forward ordering. Rather than storing the full global blending order, LiDAR-RT differentiates in the same front-to-back order as the forward pass, using
\[
\frac{\partial L}{\partial \alpha_i}
=
T_i c_i - \frac{(\mathcal{C} - \mathcal{C}_i)}{1-\alpha_i},
\]
where \(\mathcal{C}\) is the final rendered value and \(\mathcal{C}_i\) is the accumulated value up to the \(i\)-th Gaussian. The implementation launches a new `optixLaunch`, re-casts the same rays, re-obtains the sorted intersections, computes gradients with the front-to-back formula, and accumulates gradients in global buffers via atomic operations [2412.15199]. This is presented as crucial for differentiable rendering efficiency because it avoids the memory-heavy backward ordering used in camera-space 3DGS.

IRGS uses alpha blending in an analogous front-to-back form:
\[
\mathcal{C} = \sum_{i=1}^{N} T_i \alpha_i \boldsymbol{c}_i,
\qquad
T_i = \prod_{j=1}^{i-1}(1-\alpha_j).
\]
In tracing mode,
\[
(\boldsymbol{c}_\mathrm{rt}, o_\mathrm{rt}) \leftarrow \mathrm{Trace}(\boldsymbol{r}_o, \boldsymbol{r}_d),
\]
and, for a sampled incident direction \(\boldsymbol{\omega}_i\) from surface point \(\boldsymbol{x}\),
\[
(L_\mathrm{ind}(\boldsymbol{\omega}_i, \boldsymbol{x}),\, 1-V(\boldsymbol{\omega}_i, \boldsymbol{x}))
\leftarrow
\mathrm{Trace}(\boldsymbol{x}, \boldsymbol{\omega}_i).
\]
The accumulated opacity therefore gives \(1-V\), while the accumulated color gives indirect radiance \(L_\mathrm{ind}\) [2412.15867]. Because the outputs depend on Gaussian parameters, per-Gaussian view-dependent color, sorted ordering, and alpha blending, the method is fully differentiable and enables optimization of indirect light through backpropagation.

A central interpretive point follows directly from these formulations. Differentiable 2D Gaussian ray tracing is not merely a visibility oracle; it is a differentiable mechanism for aggregating task-specific attributes along a ray. In LiDAR-RT those attributes are depth, intensity, and ray-drop. In IRGS they are visibility and indirect radiance.

## 5. Task-specific instantiations

In LiDAR-RT, differentiable 2D Gaussian ray tracing is embedded in a dynamic-scene LiDAR re-simulation pipeline. The scene is decomposed into a static background and multiple foreground vehicles, and each object has its own Gaussian set. For dynamic objects, Gaussian parameters are defined in object-local coordinates and mapped into world coordinates by a tracked pose sequence \(\{R_t,T_t\}\):
\[
\mu_w = R_t \mu_o + T_t,
\qquad
R_w = R_t R_o.
\]
This functions as the scene-graph-like update mechanism. Implementation details include background point-cloud fusion across frames, KNN-based normal estimation for Gaussian orientation initialization, voxel downsampling with voxel size \(0.15\), and augmentation of object models with fewer than \(8K\) points by random sampling inside the 3D bounding box until they reach \(8K\) points [2412.15199].

LiDAR output is rendered as a range image. For a point \((x,y,z,\zeta)\),
\[
d = \sqrt{x^2+y^2+z^2},
\qquad
\theta = \arctan(y,x),
\qquad
\phi = \arcsin(z,d).
\]
The paper emphasizes, however, that the range image is the final representation rather than the core physical model: the physically accurate component is the ray-traced active-sensing simulation [2412.15199]. Training uses the total loss
\[
\mathcal{L} = \lambda_d \mathcal{L}_d + \lambda_i \mathcal{L}_i + \lambda_r \mathcal{L}_r + \lambda_{CD} \mathcal{L}_{CD},
\]
with \(\lambda_d=0.1\), \(\lambda_i=0.1\), \(\lambda_r=0.01\), and \(\lambda_{CD}=0.01\). The loss terms are depth/range \(L_1\), intensity \(L_1\), ray-drop binary cross-entropy, and Chamfer Distance between rendered and ground-truth point clouds. After Gaussian optimization, a U-Net refines sensor-level ray drop using ray origin, ray direction, and predicted depth, intensity, and ray-drop [2412.15199].

IRGS uses differentiable 2D Gaussian ray tracing inside the full rendering equation for inverse rendering:
\[
L_o(\boldsymbol{\omega}_o, \boldsymbol{x}) =
\int_{\Omega}
f(\boldsymbol{\omega}_o, \boldsymbol{\omega}_i, \boldsymbol{x})
\,L_\mathrm{i}(\boldsymbol\omega_i, \boldsymbol{x})
\,(\boldsymbol\omega_i\cdot \mathbf{n})\,
d\boldsymbol\omega_i.
\]
The BRDF is a simplified Disney-style dielectric BRDF with diffuse albedo \(\boldsymbol{a}\) and roughness \(r\), decomposed into \(f=f_d+f_s\), with \(f_d=\boldsymbol{a}/\pi\). Incident radiance is decomposed as
\[
L_\mathrm{i}(\boldsymbol{\omega}_i, \boldsymbol{x}) =
V(\boldsymbol{\omega}_i, \boldsymbol{x})L_\mathrm{dir}(\boldsymbol{\omega}_i)
+
L_\mathrm{ind}(\boldsymbol{\omega}_i, \boldsymbol{x}),
\]
where direct lighting comes from an environment cubemap, and both visibility \(V\) and indirect radiance \(L_\mathrm{ind}\) are queried on the fly by 2D Gaussian ray tracing [2412.15867].

IRGS uses a two-stage pipeline. Stage I pretrains a standard 2D Gaussian splatting model and optimizes geometry using RGB reconstruction, normal consistency, depth distortion, edge-aware normal smoothness, and object-mask opacity regularization. Stage II assigns albedo and roughness to each Gaussian, rasterizes albedo and roughness maps, uses rendered depth and normals to define per-pixel surface position and normal, samples incident directions, traces them to obtain \(V\) and \(L_\mathrm{ind}\), evaluates the rendering equation, and optimizes the final PBR color with regularizers [2412.15867].

The rendering equation is evaluated by Monte Carlo integration. For dielectric objects, IRGS uses stratified hemisphere sampling with \(N_\mathrm{r}\) incident directions per pixel, and estimates the PBR color as
\[
\mathbf{c}_\mathrm{pbr}
=
\frac{2\pi}{N_\mathrm{r}}
\sum_{i=1}^{N_\mathrm{r}}
(f_d + f_s)\,
L_\mathrm{i}(\boldsymbol\omega_i, \boldsymbol{x})\,
(\boldsymbol\omega_i\cdot \mathbf{n}).
\]
To control cost, it imposes a per-iteration ray budget \(N_\mathrm{rays}\) and reduces the number of evaluated pixels to \(\left\lfloor N_\mathrm{rays}/N_\mathrm{r} \right\rfloor\) [2412.15867]. During relighting, it does not recursively trace full indirect bounces. Instead, it ray traces and alpha blends albedo, roughness, and normal to obtain aggregated values, then applies a split-sum approximation with a prefiltered environment map and sets \(L_\mathrm{ind}=L_d+L_s\) [2412.15867].

## 6. Efficiency, empirical findings, and open technical questions

LiDAR-RT is implemented in PyTorch with custom CUDA kernels and uses NVIDIA OptiX for hardware-accelerated ray tracing. The reported training schedule is 30,000 iterations for Gaussian optimization and 500 epochs for the U-Net refinement, on a single RTX 4090 GPU, with near plane \(0.2\) and ray-tracing chunk size 16. The reported throughput is about 20.1 FPS on Waymo and about 42.7 FPS on KITTI-360. The paper attributes efficiency to the BVH over compact proxy geometry, chunked sorted intersection processing, hardware ray tracing, front-to-back differentiable accumulation, and the avoidance of full global order storage in the backward pass [2412.15199].

Its ablations clarify why the 2D formulation is used. Compared with 3D Gaussians, 2D Gaussians are reported to be slightly better in rendering quality and efficiency and to improve geometric metrics significantly. Additional ablations show that removing separate hit/drop modeling hurts quality, removing ray-drop refinement worsens results, removing ray-direction inputs to refinement loses dynamic-object detail, removing Chamfer loss degrades geometry, and removing normal-based initialization degrades scene reconstruction [2412.15199]. This suggests that, in LiDAR simulation, differentiable 2D Gaussian ray tracing is effective only when paired with explicit sensor-response modeling and geometric regularization.

IRGS is implemented in OptiX through PyTorch CUDA extensions. Because geometry changes during optimization, the BVH is updated every training iteration; the reported BVH update cost is about 3 ms. The implementation uses \(k=16\) for per-ray sorting, stops ray tracing when transmittance drops below 0.03, uses \(N_\mathrm{r}=256\) rays for rendering-equation evaluation, sets the maximum \(N_\mathrm{rays}=2^{18}\) per iteration, renders a complete image at \(N_\mathrm{r}=256\) in about 1 second, and trains in about 40 minutes on one RTX 3090 [2412.15867].

IRGS ablations isolate the role of differentiable tracing of indirect light. Detaching the indirect term degrades results, especially for indirect radiance and albedo estimation. Removing indirect during training harms albedo estimation, and removing indirect during relighting reduces relighting quality. The number of rays is also consequential: \(N_\mathrm{r}=16\) is poor, \(N_\mathrm{r}=64\) is better, and \(N_\mathrm{r}=256\) is best. The reported qualitative effects are more plausible indirect illumination, cleaner occlusion, more realistic relit images, and better material separation [2412.15867].

A recurrent technical question in this literature is whether Gaussian ray tracing should operate on volumetric 3D kernels or on 2D surface-like disks. VoGE demonstrates that differentiable ray tracing over 3D Gaussian ellipsoids can be efficient and useful for analysis-by-synthesis, but it also relies on approximate closed-form aggregation, truncation to the nearest \(K'\) kernels, and assumptions such as a perspective camera [2205.15401]. IRGS argues that 3D Gaussian ray tracing is problematic for inverse rendering because the ray–splat intersection is ambiguous and tracing a pretrained 3DGS checkpoint causes noticeable rendering degradation. LiDAR-RT reports that 2D Gaussians are slightly better than 3D Gaussians in both rendering quality and efficiency for LiDAR re-simulation [2412.15867]. A plausible implication is that surface-like 2D Gaussian primitives are particularly advantageous when the target task requires a geometrically meaningful ray hit, such as active sensing or the evaluation of visibility and indirect radiance in the rendering equation.

Source: https://www.emergentmind.com/topics/differentiable-2d-gaussian-ray-tracing