RadianceLab · Native implementation document

Two charts, one refracted chain

What the disk actually sweeps, why a plane need not add a bounce, and how the two charts meet on a common path measure.

Status: 2026-09-19. Derivation and acceptance criteria for a bounded native experiment. Implementation and measured results belong in the experiment's recording/validation report; the derivation alone does not establish the accuracy of a finite numerical solver.

The question worth testing

Can two different sheets describe the same sharp volume caustic more reliably than either sheet alone?

Keep the transport class deliberately small:

point source L -> glass entry S -> glass exit S -> one medium scatter V -> camera E

The two glass events are deterministic transmissions. There is no medium bounce before the glass and exactly one after it. This keeps the source's structure visible instead of comparing the hourglass with a diffuse higher-order fog field. Reflections, internal reflection chains, heterogeneous media, arbitrary glass meshes and a refracted camera path are outside this first comparison.

The hourglass holds the incident polar angle fixed and sweeps azimuth and exit distance. Its partner holds azimuth fixed and sweeps polar angle and exit distance. The latter is the refracted counterpart of RadianceLab's photon disk: a meridian disk chart, not a disk-shaped area emitter or a flat disk kernel placed at a scattering event.

For a point source and a spherical lens, this meridian stays in a plane. The source, sphere center, interface normals and refracted rays share that plane. Glass changes its support and can fold different incident directions onto the same location. A cheap camera-plane crossing therefore leaves a nontrivial inverse problem; it does not finish the estimator.

Does a plane require two medium bounces?

That depends on which coordinates generated it.

Construction Coordinates swept Minimum medium scattering relevant here
Two-flight distance plane Two flight distances on a photon chain A preceding medium vertex plus the final scattering event
Existing native UV emitter plane, strategy 3 Two coordinates of a quad light One medium scatter
Existing native UV/UT/VT set, strategy 12 Two of light U, light V and flight distance T One medium scatter
Photon disk, strategy 8 One direction angle and distance One medium scatter; the existing implementation does not refract through glass
Hourglass, strategy 20 Azimuth and exit distance through a spherical glass chain One medium scatter after glass
Proposed/research refracted disk Polar angle and exit distance through the same chain The same one medium scatter after glass

The multiple-bounce distance construction is the one developed in the higher-dimensional photon-sample literature. It is not a universal definition of every possible planar sweep. The project's area-emitter plane code supplies its dimensions at the light instead. Bitterli and Jarosz, Beyond Points and Beams.

Higher scattering order does not make MIS mathematically forbidden. It makes two techniques disjoint if one generates only LSSVE and the other only a longer path class. They cannot rescue each other's singularities on a path neither can generate. The meridian partner is attractive precisely because it reaches the hourglass's own LSSVE paths.

A common map, two charts

Let the point source be y, the sphere center C, radius R, relative index eta, and L=|C-y|. Put a=(C-y)/L, choose perpendicular unit vectors u,v, and define

e(phi) = u cos(phi) + v sin(phi)
phiHat = a cross e(phi)

For an incident polar angle psi, the sphere's two transmission events are described by

theta_i = asin(L sin(psi) / R)
theta_t = asin(sin(theta_i) / eta)
gamma   = psi - theta_i + 2 theta_t
chi     = psi - 2 theta_i + 2 theta_t

z2   = L + R cos(gamma)       rho2 = R sin(gamma)
wz   = cos(chi)               wr   = sin(chi)
exit = y + z2 a + rho2 e
omega = wz a + wr e
X(psi,phi,r) = exit + r omega

psi lies in the sphere's incident cap, 0 < psi < asin(R/L). Positive r is the distance from the exit interface. All finite scene, medium and visibility tests apply after reconstructing the complete path.

For a normalized camera ray o+s d, introduce the derivatives X_psi, X_phi and X_r=omega and

J_H = abs(dot(cross(X_phi, X_r), d))
J_D = abs(dot(cross(X_psi, X_r), d))
D   = abs(dot(X_psi, cross(X_phi, X_r)))

Hourglass samples psi with density p_psi, sweeping (phi,r). Disk samples phi with density p_phi, sweeping (psi,r). The per-branch densities induced along camera distance are

q_H(s,branch) = p_psi J_H / D
q_D(s,branch) = p_phi J_D / D

These are expected crossing intensities: a sheet may deposit more than once. They need not integrate to one over the whole ray. Every valid crossing and every distinct refracted branch contributes.

For uniform emitted solid angle on the incident cap, p_psi=sin(psi)/(1-cos(psiMax)); for the meridian chart, p_phi=1/(2 pi). Other sampling laws are possible, but their actual densities must be used.

Use the same physical numerator for both charts,

F = I(omega_in) sin(psi) T_entry T_exit
    * sigma_s phase(omega,-d) Tr_light Tr_exit Tr_camera * visibility

Here I is emitted intensity per solid angle. The sin(psi) belongs to the angular integration measure. For source selection or sampled area-light positions, include their shared sampling factors consistently. Fresnel transmission is in F because both charts deterministically follow the transmitted branch; it is not a random branch probability in their chart densities. Glass absorption, if added, is another matched payload factor. The two interface radiance index factors cancel because the chain begins and ends in the same optical medium.

The individual estimators deposit F/(p_psi J_H) or F/(p_phi J_D). At a shared physical branch, D cancels from balance MIS:

A_H = p_psi J_H
A_D = p_phi J_D
w_H = n_H A_H / (n_H A_H + n_D A_D)
w_D = n_D A_D / (n_H A_H + n_D A_D)

For one randomly selected chart per sample with probabilities alpha_H and alpha_D, each accepted root contributes

F / (alpha_H A_H + alpha_D A_D)

after accounting for any other shared sampled dimensions. Do not apply another factor of two to this one-sample mixture. The balance heuristic combines densities on a common measure and includes the actual sample allocation. Veach, Multiple Importance Sampling, Chapter 9.

Per-branch is important: summing disk roots in one denominator while evaluating only the hourglass's actual branch in the other does not define a common weight. A valid alternative would marginalize all techniques over the same unknown branches, but is unnecessary here.

The cheap solve and the expensive part

For a sampled meridian, intersect the camera ray with its full plane:

s = dot(y-o,phiHat) / dot(d,phiHat)
x = o+s d
z = dot(x-y,a)
rho = dot(x-y,e(phi))              // signed, not a length

Solve every admissible root of

R(psi) = wz (rho-rho2) - wr (z-z2) = 0
r(psi) = wz (z-z2) + wr (rho-rho2) > 0

The signed radial coordinate is essential. After focus, a ray emitted on the positive side of its meridian may cross to negative rho. The unrefracted disk's positive-half-plane rejection must not be copied blindly. A second sampled azimuth phi+pi represents different incident rays, even though its support plane is the same.

Define

theta_i' = L cos(psi) / (R cos(theta_i))
theta_t' = L cos(psi) / (eta R cos(theta_t))
gamma'   = 1 - theta_i' + 2 theta_t'
chi'     = 1 - 2 theta_i' + 2 theta_t'
M        = R cos(theta_i) gamma' + r chi'

Then R'(psi)=-M when r is the projection above, including away from a root. This gives the inverse solver an analytic derivative. At a root,

rho_signed = rho2 + r wr
m = wz e(phi) - wr a
J_H = abs(rho_signed) abs(dot(m,d))
J_D = abs(M) abs(dot(phiHat,d))
D   = abs(rho_signed M)

These formulas give a cheap independent check of the vector derivatives. Changing from psi to c=cos(psi) divides J_D and D by sin(psi) while replacing p_psi with p_c sin(psi) in the sampled-angle density. The full estimator must change coordinates consistently; mixing the cosine-coordinate Jacobian with the polar-angle numerator is an energy error.

A fixed sign-change grid can miss two nearby roots around a fold. Bracket stationary points using R', subdivide monotonic intervals, bracket R on each interval and refine in double precision. Check root convergence under further subdivision. A finite root grid without a completeness argument remains a numerical limitation; increasing it is a useful diagnostic, not a proof.

Where the partner can help—and where it can lose

An entirely useful outcome is: the meridian is a valid alternate chart, but the hourglass alone is the practical choice in this setup. The experiment should preserve that result rather than tune a scene solely to force a win.

Area-light planes through glass: the next experiment

An area source can supply sweep dimensions without any pre-glass medium scattering. Write its position as Y(u,v) and the full refracted map as X(u,v,theta,phi,r). For fixed sampled incoming direction:

Through a sphere, UV generally becomes a curved surface; UT and VT remain ruled in exit distance but are not generally planes. Their camera crossing is a nonlinear solve. A rotated source coordinate basis gives additional emitter-line charts; it does not itself create a new scattering order.

To MIS these with a point-sampled hourglass, condition on the same area emitter and compare joint densities on the same remaining path coordinates, including source-area Jacobians. The disk/hourglass's convenient cancellation for a fixed source point cannot simply be reused while treating a swept source location as if it had been sampled.

A large quad may give useful broad sheet support, but it also averages displaced caustics and can reduce source-to-glass interception. Keep emitted power and camera exposure matched when comparing source sizes. This area-light extension is a proposal until its inverse solver, support and measure have been implemented and checked. It should not be captioned as an existing refracted UV/UT/VT renderer.

Acceptance and recording checklist

  1. Index one recovers the same cap-restricted cone and meridian estimators without refraction.
  2. Snell construction, analytic derivatives and finite-difference derivatives agree away from singular endpoints.
  3. Round trips retain pre-focus and post-focus signed branches; multiple-root test cases are explicit.
  4. Common weights are finite/nonnegative and sum to one on valid shared paths. Visibility, finite-medium bounds and numerical rejection gates agree between cross-evaluations.
  5. Compare hourglass, disk and declared mixture against camera-distance integration of the same branch-resolved transport. This reference is separately parameterized but still shares the Snell model, so it is not an independent general path tracer.
  6. Show a narrow caustic, a camera grazing one sheet family, and a failure case. Report raw linear error as well as matched-exposure images.
  7. Compare equal samples and equal wall time. Record root work and missed/invalid roots rather than presenting only the cheapest plane crossing.
  8. Clearly separate the native numerical experiment from the browser's illustrative mesh and display glow. Neither a finite root solve nor a beautiful image alone justifies a universal unbiasedness or speed claim.

Local references: docs/hourglass/hg_mis_spec_full.txt, docs/hourglass/FLAVOURS.md, src/render/PPIntegrator.cpp strategies 3/8/12/20, src/render/SurfaceCurveMeasure.h. The last file concerns forward receiver curves; its equal emitted-direction marginals do not imply equal inverse-camera chart weights.