Is the light under a raindrop accurate?
Every raindrop on the glass is a small lens, so it throws a pattern of light onto the photograph behind. I worked that pattern out once, offline, into a lookup table. A path-traced reference then showed the live drops were missing their bright ring, and the cause was a wrong slope estimate.
On 2 October I wanted the light passing through the drops to cast shadows at the bends and bright focus lines where it is refracted and concentrated. That is about the photograph under the glass, more than the drop itself.
Light that would have landed on the print beneath a drop’s footprint is bent. Whether you see a bright spot or a dark one depends on the distance to the print against the drop’s focal length. Close to the focus: a bright core inside a dark ring. Much farther: the light is spread thin and the footprint becomes a dark spot with a faint halo.
A formula failed for beads, so each drop’s light is traced in advance
The light system already had a formula for caustics, the bright lines light makes after a curved surface, from how curved a surface is. The research showed it fails for beads: their bending, about 6 mm, is bigger than the bead. So the answer was per-drop profiles, traced once offline.
The table has 48 rows for the ratio of the gap to the focal length, from 0.25 to 16 on a log scale, repeated for four sizes of lamp penumbra (the soft fringe of a shadow: 0, 0.5, 1 and 2 times the contact radius), and 64 columns of distance from the centre. One texture, 64 by 192, stores the brightness against a plain pane: red holds up to 1, green holds the excess in eighths.
It is made at a single 45 degree contact angle, a compromise between a fresh bead and a flattened one. When the water is drawn, every drop’s pattern goes into one map, and the light under the glass multiplies the lamp by it.
With the site’s lamp, single-drop shadows are faint
The site’s lamp is 11.5 mm in radius, 75 mm away, so its angular radius is 8.7 degrees. At the site’s gap, single-drop shadows from that bulb are faint smudges.
That is the physics, and the existing light-size presets produce it without extra work. A small or distant light gives crisp rings.
A path-traced check: drops by a lamp are darker, with a thin bright ring
The corrections up to then had been estimates, and the lighting did not look right to me, so the exact setup was built in Mitsuba 3, an open-source path tracer (a renderer that follows light ray by ray).
The scene: a 4.5 mm pane with a frosted back face, 327 drops of water on it at a 50 degree contact angle, a lamp 75 mm in front, the photograph either 15 mm behind (a print) or 3 m behind (the world), 768 samples a pixel.
Measured across six drops, the inside of a drop was 0.1 to 0.5 of the frost beside it: drops by a lamp are darker, not brighter. There was a thin bright ring at 70 to 90% of the contact radius, 1.5 to 2.2 times the frost, and a small glint at the centre, 2 to 4 times.
The ring was missing because of a slope estimate
The live drops had no bright ring at all. The slope of each drop was estimated from neighbouring pixels of the map (a finite difference). Across a drop a millimetre wide, that averages the steep last tenth of the radius with the flat glass outside it, so the steepest slope it found was about 38 degrees (31 at 1× scale) where the real cap reaches 50.
The band where reflection becomes total is 41 to 49 degrees, so no drop ever got there. The map now writes each drop’s exact slope into its own channel. The ring is brightest on the lower side, because a drop on an upright pane sags: steeper below, about 60 degrees, shallower above, about 40.
Two findings still to decide
The reference also said two things about the rest of the site that I have not yet decided on: the light layer is about ten times brighter than a lamp of that size would make it, and the frost shows the photograph more clearly than a world 3 m away would.
Sources and notes (13)
- Garg & Nayar 2007, appearance of raindrops — a drop passes about 94% of light and shows a wide, inverted view
- Wikipedia: Ball lens — a drop as a ball lens
- Wikipedia: Thin lens — focal length of a drop on glass
- Lock 2020, caustics — caustics of a drop
- Wikipedia: Caustic (optics) — the caustic formula that failed for beads
- GPU Gems: Rendering Water Caustics — caustics in real time
- Rain research, round 3 — the notes this was written from
- Rain research notes — the notes this was written from
- Water drops research — the notes this was written from
- Path-traced check script — the notes this was written from
- Drop lens table script — the notes this was written from
- Lens map code — the notes this was written from
- Rain system design — the notes this was written from
Water, rain & windAll 11 parts →
