← Technical Notes F26

Baking disco-ball caustics for Unreal: three methods compared

Technical notes · Disco Ball · GAME 710, Fall 2026

The light spots a disco ball throws on a wall are caustics: light reflected by thousands of small flat mirrors. Lumen can't compute them, and neither can the path tracer in a usable time. So each mirror's reflection is computed offline in Houdini, baked into textures, and projected in Unreal by a point light's light function. This note covers the spot model, three ways to bake it and how they compare, the coordinate conventions, and the toy plane that flies through the same attic.

What decides each spot

Every spot comes from one mirror tile, and all four of its properties are computed from the geometry and the light. None is placed by hand.

PropertyComes from
PositionThe light's direction reflected by the tile normal. The light sits on the spin axis, so when the ball turns, the whole pattern turns rigidly with it.
SizeA flat mirror reflecting a point light makes a diverging beam. Near the wall the spot is about the size of the tile; further away it grows with distance.
EdgeThe bulb's radius blurs the edge over an angle θ = bulb radius / distance to the tile: a sharp square near the wall, a soft round blob far away.
BrightnessLight flux over solid angle, so tiles hit at a grazing angle are dimmer. One normalisation is shared by all bakes.

The tiles are found automatically. Each sequin on the model is actually a thin box with six faces; only faces with the reflective material whose normal points outward (dot with the radial direction above 0.9) count. That gives 5,467 mirrors.

A light function only knows direction, but spot size and brightness depend on how far away the wall is. So the bake is made at three reference distances, 40, 120 and 360 cm, and the material blends between them by the distance to the light on a log scale. The three colour groups of tiles go into the R, G and B channels, one coloured point light each.

Baked lat-long caustics map at the 120 cm distance
The 120 cm bake as a lat-long map

Three edge models

A real spot is the tile's square convolved with the bulb's disc. Three ways to draw that edge, each checked against a photon-splatting reference:

Edge modelHowCorrelation with reference
0: SDF smoothstepRounded-rectangle distance, smoothstep over the blur angle~0.97
1: disc-cut edgeSame distance, edge replaced by the area of a disc cut by a line~0.975
2: exact convolutionOverlap area of disc and square per pixel: 12-point Gauss–Legendre one way, analytic chord overlap the other0.992–0.994

The exact convolution matches best at almost no extra cost, so it is the production edge: 0.982 even with size jitter on, against 0.953–0.960 for the simpler model.

Three ways to bake

The same spot model was written three ways:

Method (edge 2)CorrelationEnergyIoUTime per layer
Python + numpyreference1.001.00~2.5–3 s (CPU)
Wrangle + pcfind1.0001.0001.00~2.6 s
Projected raster0.985 / 0.968 / 0.9551.000.89 / 0.83 / 0.81~6 s

Raster values are at 40 / 120 / 360 cm; timings are at 120 cm on an RTX 5090. The Wrangle matches Python to within one RGBE quantisation step (maximum difference 0.0039).

The raster method is the slowest despite running on the GPU: overlapping spots have to be split into up to six layers and summed, and each extra pass on the 6144 × 3072 atlas costs about 0.6 s. The Wrangle runs in VEX on the CPU and updates live while tuning.

Side by side images of the three bake methods
Python, Wrangle and raster side by side
Copernicus network for the Wrangle bake
The Copernicus Wrangle network
Cross-section plots of one spot at three distances, exact method against the blurred raster
One spot's cross-section at 40, 120 and 360 cm: exact (Wrangle / Python) against the blurred raster

Conventions that must be exact

Four conventions keep every spot on the right axis:

StepConvention
Houdini → Unreal mesh(x, y, z) → (x, z, y), 1 unit = 1 cm
Lat-long → cube mapu = 0.5 + atan2(V.x, −V.y) / 2π, v = acos(V.z) / π
Light vector in a light functionArrives as the light's local .zyx, so the material starts with return LV.zyx;
FBX UVs on importV is flipped to 1 − V, so Houdini stores 1 − v

A test bake with markers of three sizes at +X, +Y and +Z confirms the orientation and the handedness in one look.

Light function graph: Light Vector into a LightLocalDir custom node, three cube map samples, a DistanceBlend custom node with near and far distances, dot with a channel mask, times intensity
M_DiscoCaustics_LF: LV.zyx into the three bakes, blended by distance, then one colour channel per light

Unreal settings

Material graph: tile direction from UV channel 1, transformed to world space, normalized, dotted with the camera vector, smoothstep from 0.999, times glint intensity and group colour
Glints: each tile's reflected direction (UV channel 1) against the camera vector; SmoothStep from 0.999 lights a tile only inside its spot
The ball turning; the spots and light shafts turn with it.

The toy plane

The same attic has a paper plane you can fly. It runs on one integer state; clicks only advance it:

StateCameraPropellerPlane
0 IdleRoomStoppedParked
1 ReadyBehind the planeStoppedParked
2 Warm-upBehind the planeSlow, lights onParked
3 FlyingBehind the planeFull speedWASD + mouse
4 ReturnRoomBack to slowTeleported home
Blueprint component tree: Hitbox with CamPivot, SpringArm and Camera, two engine audio components, PlaneRoot with PitchPivot, Body, ControlRig and the propeller
Components: PitchPivot banks and pitches the body; ControlRig is the empty component at the propeller hub
Flying the plane through the attic.

What I'd keep