Doppler spectrum path tracer (DopplerHistogramPathTracerInline)¶
This render pass renders the spectrum that optical heterodyne detection (OHD) measures: for every pixel, how much light arrives at each beat frequency. With a single-frequency laser, the beat frequency is the Doppler frequency shift; with a chirped laser, as in an FMCW lidar, it also depends on the path length (see FMCW). It evaluates the OHD path integral of Kim et al. (2025), the same form as the transient histogram but resolved by Doppler shift instead of path length: every path adds its contribution to the bin of its shift
where \(\lambda\) is the laser wavelength and \(u\) the path velocity: over the path’s segments \(x_k \to x_{k+1}\) (from the light towards the camera, direction \(\hat{d}_k\), refractive index \(\eta_k\)), the velocity of their endpoints along the segment. Refractive indices are not implemented yet: \(\eta_k = 1\) on every segment. \(\Delta f\) is positive when the path shortens, for example for an object coming towards a camera with the light next to it.
The scene does not move. Every object is given an instantaneous velocity (see Velocities), which only decides the bin of each path; the contribution is that of the static path.
FMCW¶
With chirpBandwidth \(B > 0\), the laser frequency sweeps by \(B\) over chirpDuration \(T\), up and then down (a
triangular chirp). A path’s beat frequency then also has a range term, from its optical path length
\(l(\bar{\mathbf{x}}) = \sum_k \eta_k \lVert x_{k+1} - x_k \rVert\) (Kim et al. 2025, Eqs. 9 and 33):
The pass writes the up-chirp spectrum to spectrum and the down-chirp spectrum to spectrumDown, on the same bins.
A peak’s position thus mixes distance and velocity, and the two chirps separate them: with the light next to the
camera, a surface at distance \(d\) moving towards the camera at \(v\) has \(l = 2d\) and \(\Delta f = 2v/\lambda\), so
With \(B\) in GHz, \(T\) in µs and scene units in meters, \(f_R\) is \(3.336\,B/T\) MHz per meter of path length. The bins keep the sign of \(f_R \mp \Delta f\); a range from 0 MHz covers every path whose range term exceeds its Doppler shift.
Parameters¶
Spectrum:
Parameter |
Type |
Description |
|---|---|---|
|
float |
Laser wavelength \(\lambda\), nm. (Default: |
|
float |
Chirp bandwidth \(B\), GHz: the laser frequency sweeps by \(B\) over |
|
float |
Duration \(T\) of each sweep, µs. Used when |
|
float |
Range of Doppler shifts (with a chirp, of beat frequencies), MHz. Paths outside |
|
integer |
Number of bins. (Default: |
|
dictionary |
The motion of the scene objects; see Velocities. (Default: none) |
|
float3 |
Velocity of the camera, m/s. (Default: |
|
float3 |
Velocity of the light’s origin (the laser or point light), m/s. (Default: |
Sampling and output, as for the transient histogram path tracer:
Parameter |
Type |
Description |
|---|---|---|
|
integer |
Camera paths traced per pixel in each frame. (Default: |
|
integer |
Maximum number of surface vertices on a camera path, counting the primary hit. Each vertex is connected to the
light (the primary hit only with |
|
boolean |
Include the path camera -> primary hit -> light. (Default: |
|
boolean |
Importance-sample the BSDF when extending a camera path. (Default: |
|
boolean |
Sum the frames in the spectrum, restarting when the camera moves, a setting changes, the render graph is
recompiled (e.g. on a resize), or |
|
boolean |
Store one channel per bin, chosen by |
|
string |
|
|
boolean |
Honor alpha-tested materials when tracing rays. (Default: |
|
string, integer pair |
Size of the outputs, as for the transient histogram path tracer; the |
Participating media (see Participating media):
Parameter |
Type |
Description |
|---|---|---|
|
boolean |
Render the homogeneous media inside closed meshes, with the point light. Off, or with the laser, a medium’s mesh
is an ordinary surface. (Default: |
|
integer |
Maximum number of scattering events in media on a camera path; Russian roulette ends most paths earlier.
(Default: |
|
dictionary |
Medium properties in full precision, by material name, replacing the material’s own:
|
Participating media¶
With useVolumes, paths also scatter inside media, and every scattering event is a path vertex: its scatterer adds
its velocity to the path velocity, as a surface vertex does. This simulates, for example, coherent light scattered by
tissue with blood flowing in a vessel.
Media. A mesh is a medium when its material has volume absorption or scattering:
volumeAbsorptionandvolumeScattering(per scene unit, so per meter) andvolumeAnisotropy, the \(g\) of a Henyey-Greenstein phase function. In a Mitsuba scene, give the shape a homogeneousinteriormedium withsigma_sandsigma_a; the importer reads no phase function, so the medium scatters isotropically. The mesh must be closed, with its normals facing out. Media may be nested, up to 4 deep (a vessel inside tissue), but must not overlap or touch.Precision. Falcor stores a material’s volume coefficients and \(g\) as 16-bit floats: at most 65504 per meter, which the scattering of whole blood in the near infrared (several \(10^4\) per meter) can exceed, and about 3 significant digits (\(g = 0.99\) becomes 0.9902, so \(1 - g\) is 2% off). Give such media in
media, which holds them in full precision.Boundaries. A medium’s surface is a smooth interface between its material’s
indexOfRefractionand that of what surrounds it (the enclosing medium, or 1). A path reflects or refracts there, chosen by the Fresnel reflectance, and the interface point is a path vertex that moves with the medium’s object. Where the two indices are equal, rays cross unchanged and paths have no vertex there (a vessel inside tissue of the same index).Light connections. From a vertex in a medium, a connection goes straight to the light through index-matched boundaries, or refracts once, where Snell’s law holds on the boundary triangle (for example, at the tissue surface). A connection that would refract at two boundaries is not made, so that light is missing (for example, a vessel whose index differs from its tissue’s). Where light could arrive through two faces of a medium (near an edge of a box), only one is found.
Motion. The scatterers move with their object’s motion in
velocities(see Velocities), for example a translating or rotating medium, or blood in a Poiseuille flow (flowOrigin,flowAxis,flowRadius,flowMaxSpeed).Brownian motion. The scatterers of an object with a
diffusioncoefficient \(D\) (m²/s) also diffuse. A scattering event at angle \(\theta\) in a medium of index \(n\) decorrelates the path’s field at the rate \(q^2 D\), with \(q = 2 k \sin(\theta / 2)\) and \(k = 2 \pi n / \lambda\), so a path’s line becomes a Lorentzian of half width \(\sum q^2 D / (2 \pi) = \sum 4 \pi n^2 D (1 - \cos\theta) / \lambda^2\) around its Doppler shift, summed over its scattering events. Scatterers diffuse independently (as in diffusing-wave spectroscopy). The pass samples each path’s Lorentzian, so a broad line needs more samples than a sharp one, and the light of its tails beyond the frequency range is not in the spectrum.Vessels as grids.
set_vessels(medium, fraction, velocity, origin, size, scattering, absorption, anisotropy=0, diffusion=0)puts blood vessels into the medium of the material namedmedium, from numpy arrays: the blood fraction, shape (nz, ny, nx), and the blood’s velocity in m/s, shape (nz, ny, nx, 3), at the centers of the cells of the box fromorigintoorigin + size(x along the last axis), interpolated between them.scatteringandabsorption(per meter),anisotropyanddiffusion(m²/s) are the blood’s. There, the medium mixes its coefficients with the blood’s by the fraction: its free flights are delta tracked and its transmittances ratio tracked, against the larger of the two extinctions, and a scattering event is the blood’s or the medium’s in proportion to their scattering. The vessels may branch and curve freely. One medium holds vessels at a time;clear_vessels()removes them. See the vascular network of the LSCI application.Light. Media take the point light (
isLightSourceLaser = falseon theLaserLightpass). With the laser,useVolumesis ignored and media meshes render as ordinary surfaces.Counts.
maxBouncescounts surface vertices only, andcomputeDirectdecides only for the path camera -> primary hit -> light: light scattered once in a medium is always included. A path ends after 64 reflections and refractions at medium boundaries.
Light¶
The light is set on the LaserLight pass, as for the time-gated path tracer. A lidar has its light next to
the camera: isLightSourceLaser = false with laserCollocated = true puts a point light at the camera.
Inputs and outputs¶
Channel |
Description |
|---|---|
|
Primary hits, from |
|
Primary ray directions, from |
|
Doppler spectrum (with a chirp, the up-chirp spectrum), |
|
The down-chirp spectrum, as |
|
The steady image (the spectrum summed over all shifts, including those outside the range), RGBA32Float. |
From Python: reset(), set_velocity(...), clear_velocities() and get_object_names(), which returns
(instance, mesh name, material name, movable) for every object of the scene.
Example¶
testbed.load_scene("cornell-box/scene-v4-nolight.pbrt", falcor.SceneBuilderFlags.DontMergeMaterials)
graph = testbed.create_render_graph("DopplerSpectrum")
graph.create_pass("VBuffer", "VBufferRT", {"samplePattern": "Center", "sampleCount": 1})
graph.create_pass("Light", "LaserLight", {"isLightSourceLaser": False, "laserCollocated": True})
graph.create_pass("Tracer", "DopplerHistogramPathTracerInline", {
"samplesPerPixel": 64, "maxBounces": 3, "computeDirect": True,
"wavelength": 1550.0, "frequencyMin": -100.0, "frequencyMax": 100.0, "frequencyBin": 256,
"velocities": {"TallBox": {"linear": [0.0, 0.0, 20.0]}},
})
graph.add_edge("VBuffer.vbuffer", "Tracer.vbuffer")
graph.add_edge("VBuffer.viewW", "Tracer.viewW")
graph.add_edge("Light", "Tracer")
graph.mark_output("Tracer.spectrum")
testbed.render_graph = graph
An FMCW lidar with a 1 GHz chirp over 1 µs, whose beat frequencies fall between 0 and 100 MHz in this scene:
# The same graph with this tracer instead:
graph.update_pass("Tracer", {
"samplesPerPixel": 64, "maxBounces": 3, "computeDirect": True,
"wavelength": 1550.0, "chirpBandwidth": 1.0, "chirpDuration": 1.0,
"frequencyMin": 0.0, "frequencyMax": 100.0, "frequencyBin": 512,
"velocities": {"TallBox": {"linear": [0.0, 0.0, 20.0]}},
})
graph.mark_output("Tracer.spectrum") # up-chirp
graph.mark_output("Tracer.spectrumDown") # down-chirp
See the Doppler spectrum tutorial and the FMCW lidar tutorial for complete scripts.