Why backlit hair turns into a rainbow
Hold your forearm so it just hides the sun. The fine hairs along its edge light up in short sparks of colour: violet, gold, green, pink. They are not reflecting and not acting as prisms. Each hair is a slit in reverse. It diffracts sunlight, and the colours appear at angles set by the ratio of wavelength to hair thickness.
Every glint in the piece is computed from the diffraction of a cylinder, convolved with the real size of the sun's disk, weighted by the solar spectrum and converted to colour through the CIE 1931 observer. Nothing is painted.
What is actually happening
1. Each hair diffracts. A hair is an obstacle a few tens of micrometres wide. By Babinet's principle, the light it scatters into small forward angles is the same as the light that would pass through a slit of the same width. That pattern is a sinc² with dark fringes at sin θ = mλ/d. Blue light reaches its first dark fringe at a smaller angle than red light. So at a given angle from the sun, some wavelengths are dark and the rest are bright, and the hair shows the leftover colour.
2. Only the parts of a hair lying across the sun's direction glow. A long cylinder conserves the component of light's momentum along its axis. Scattered light therefore leaves on a cone around the hair (the same geometry that makes spider-web glints line up in rings). You see a point of hair light up only if the direction to your eye lies on that cone. Near the sun, that means the hair must lie roughly perpendicular to the line joining it to the sun. On a curved hair, this is true over a short stretch, so you see short sparks that slide along the hair as it moves.
3. The sun's disk sets which hairs show colour. The sun is 0.53° wide, not a point. Every point on the disk makes its own fringe pattern, offset by up to 0.53°, and they add up. Fringes narrower than the disk wash out. The fringe spacing is λ/d, so this happens when the hair is thicker than roughly λ/(0.53°) ≈ 60 µm. That is why the colours are vivid on fine body hair (vellus, roughly 10–30 µm) and weak on thick scalp hair (70–120 µm), whose colours are crowded within a degree or two of the sun.
4. The light refracted through the hair is not the rainbow. Light passing through the keratin (n ≈ 1.55) is bent into a broad forward lobe spanning 0–100°. It gives blond hair its golden rim glow. Keratin's dispersion is tiny, so this lobe is tinted by melanin absorption, not split into a spectrum.
5. The cuticle scales could act as a grating, but its strength is unknown. Scale edges every 5–8 µm form a rough grating along the hair. That would throw spectra about λ/Λ ≈ 5° along the hair's cone. No measurement of its transmission efficiency exists, and the scales are irregular, so the picture leaves it out. (The code keeps the model, switched off.)
Equations used
Fiber diffraction (Fraunhofer, Babinet strip of width d)
At oblique incidence the transverse wavenumber becomes k·sin ψ and the deflection inside the cone becomes φ, but θ ≈ φ·sin ψ. So in terms of the angle you actually measure from the sun, the fringe positions do not depend on how the hair is tilted.
Cone condition and the sun's disk
⟨f⟩ is averaged analytically over each hair segment, so short glints are not missed between sample points. r is the eye-to-hair distance, and E is the solar irradiance.
Refracted lobe (TT), after Marschner et al. 2003 and pbrt-v3
Sunlight and colour
Constants and how sure they are
| Quantity | Value | Status | Source / reasoning |
|---|---|---|---|
| Sun angular radius R | 0.2666° | measured | Mean apparent solar radius 959.6″. |
| Sun spectrum | Planck 5772 K | approximation | Effective temperature (IAU 2015). Ignores Fraunhofer lines and the UV/blue deficit of the real spectrum, which changes hues slightly. |
| Atmosphere | Rayleigh only | approximation | Hansen & Travis 1974; Kasten & Young 1989 air mass. Aerosols and ozone ignored, so low sun is less red than reality on a hazy day. |
| Limb darkening | I(μ) = 1 − 0.6(1 − μ) | estimate | Linear law, visible-band average coefficient; wavelength dependence ignored. Small effect on fringe contrast. |
| Colour matching | CIE 1931 2° | standard | Analytic multi-lobe fit of Wyman, Sloan & Shirley 2013 (error about 1% of peak). |
| Vellus hair diameter | ≈ 10–30 µm | measured | Clinical convention: vellus ≤ 30 µm. Scalp terminal hair 60–120 µm by ancestry. |
| Diameter spread | 20% (default) | estimate | Lognormal spread between hairs. |
| Tip taper | last 25% narrows to 40% | estimate | Vellus hairs taper to a point. The narrower tip spreads the fringes wider, so colour changes toward the tip. |
| Ellipticity | 1.1 (major/minor) | measured range | Marschner et al. 2003 report a minor/major ratio of 0.85–1 typical, 0.7–0.8 in samples. The projected width changes as the hair twists. |
| Twist rate | up to ±0.3 rad/mm | estimate | No data for body hair. |
| Keratin refractive index η | 1.55 | measured | Marschner et al. 2003. Dispersion (Δn ≈ 0.01 across visible) ignored. |
| Melanin absorption σ_a | C_eu·(0.419, 0.697, 1.37) + C_ph·(0.187, 0.4, 1.05) | fitted model | pbrt-v3 hair (Chiang et al. 2016), per unit radius. Here it is scaled by radius/40 µm, which assumes the fit is for a typical 80 µm scalp hair estimate. |
| TT lobe shift and width | α_TT = 1.5°, β_TT = 3.5° | measured range | Marschner et al. 2003, Table 1: α_R from −10° to −5°, cuticle tilt ≈ 3°, β_R 5–10°, β_TT = β_R/2. |
| Cuticle scale spacing Λ | 6 µm (default) | estimate | Cuticle cells are ≈ 50 µm long and overlap by up to 5/6 (Wolfram 2003), which leaves ≈ 8 µm exposed. Spacing jitter is set to 20%. |
| Cuticle grating efficiency | 0.15 per order | unknown | Not measured for transmission, so the grating is left out of the picture. |
| Sky colour | S(λ)·λ⁻⁴ | approximation | Single Rayleigh scattering. Multiple scattering and aerosols would make it paler. The near-sun whitening is a display estimate. |
| Cloud optical depth | τ = 14·c² | estimate | Gives τ ≈ 1–5 at thin edges (glints dim) and τ ≫ 10 in cores (glints vanish), matching typical cumulus values. Cloud shapes are procedural noise. |
| Cloud drift | 0.22°/s | estimate | 10 m/s wind at 1.5 km cloud base, seen overhead. |
| Hair length, density, curl | illustrative | estimate | Chosen to look like a forearm. They change where glints fall, not the colour at a given angle. |
What this model leaves out
- The exact Lorenz–Mie solution for a cylinder. Fraunhofer theory is accurate when d ≫ λ and θ is small. For spider silk (≈ 3 µm), treat the colours as indicative.
- Interference between the diffracted wave and the refracted wave. They are added as intensities. Wave-optics renderers (Xia et al. 2020) show that this adds speckle-like structure to backlit fibers.
- Polarization. Sunlight is unpolarized, and near-forward diffraction barely depends on polarization.
- Surface reflection (R) and the internal-reflection lobe (TRT), which mostly go backward, toward the sun.
- Radiometric brightness of the sky and clouds (they are drawn at a display level), glare in your eye, and the hair's own shadow. Hold up an arm, a book or a building to block the sun, as in this scene.
- The chord across the sun disk is separated into a radial and a transverse part. This is exact once a glint sweeps across the disk, and slightly approximate for a perfectly straight, still hair.
About the picture
Some display choices, which are not physics. The camera exposes automatically for the brightest glints, which are tens to hundreds of times brighter per arc-minute than a sunlit white card. Brightness is shown through a square-root tone curve so that the dimmer, more colourful glints further from the sun stay visible next to the white ones, roughly as your eye manages it.
The sky and the arm are drawn at a brightness of their own. At an exposure that suits the glints, a clear blue sky (around a fifth of a white card) would be hundreds of times dimmer than a glint and would print as nearly black, and so would the arm, which is in its own shadow. A bright glint therefore covers the sky behind it, and dim strands let it show through.
Clouds
The sky's colour comes from the same sunlight scattered by air molecules: single Rayleigh scattering, S(λ)·λ⁻⁴, through the same colour pipeline as the glints. It is whitened slightly near the sun, where haze scatters light forward.
Clouds drift at about 0.22° per second, roughly a 10 m/s wind at 1.5 km. When one crosses the sun, the direct beam reaching the hairs drops to T = exp(−τ), and every glint dims by the same factor. Exposure is held at the clear-sun value, so you see the fade instead of the camera correcting it. Light scattered through the cloud does not bring the colours back. It arrives from a patch of sky many degrees wide, far wider than the 0.53° disk that already washes out fringes on thick hairs, so under cloud the hairs turn grey. That is why you only see the rainbow in direct sun.
Fixed in the picture: sun 35° above the horizon (air mass 1.74), diameter spread 20% between hairs, ellipticity, length and count per hair type. The sun's height only changes the colour of the light slightly through Rayleigh reddening.
Sources
- Marschner, Jensen, Cammarano, Worley, Hanrahan. Light Scattering from Human Hair Fibers. SIGGRAPH 2003.
- Xia, Walter, Michielssen, Bindel, Marschner. A Wave Optics Based Fiber Scattering Model. SIGGRAPH Asia 2020. (Strong, colourful forward scattering of backlit fibers that ray models miss.)
- Xia, Walter, Hery, Maury, Michielssen, Marschner. A Practical Wave Optics Reflection Model for Hair and Fur. SIGGRAPH 2023. (Cuticle scales and colourful glints.)
- Chiang, Bitterli, Tappan, Burley. A Practical and Controllable Hair and Fur Model. 2016; Pharr, Jakob, Humphreys, pbrt-v3.
- van de Hulst. Light Scattering by Small Particles, 1957; Bohren & Huffman, 1983 (cylinder scattering, Babinet).
- Wyman, Sloan, Shirley. Simple Analytic Approximations to the CIE XYZ Color Matching Functions. JCGT 2013.
- Hansen & Travis 1974 (Rayleigh optical depth); Kasten & Young 1989 (air mass).
- Wolfram. Human hair: a unique physicochemical composite. J Am Acad Dermatol 2003 (cuticle cell size).
- Lynch & Livingston. Color and Light in Nature (diffraction colours of threads and webs).