Skip to content

Soap Film Field

A living soap film on black, lit like a macro photograph. Its colours are real thin-film interference computed from a simulated film that drains, convects and swirls. The cursor is a stream of air that stirs the bands into spirals, and a click puffs open a hole of black film.

WebGL20 deps1 file · 42 KB TSXreduced-motion aware

Preview

Props

0.42
0.5
Air stream cursor

The source is part of Pro

$27/month or $179 once. See Pro

No runtime dependencies
"use client";

import { useEffect, useRef } from "react";
import type { CSSProperties, ReactNode } from "react";

/**
 * SoapFilmField — a living soap film, close up, lit like a macro photograph.
 *
 * The colours are not a gradient. They are thin-film interference computed
 * the physical way: for every pixel the film's thickness in nanometres sets
 * how light reflected off its front and back surfaces interferes, wavelength
 * by wavelength (Airy reflectance, n = 1.33), integrated against the CIE
 * colour-matching functions. So the film shows the real order of colours a
 * bubble shows: black film where it is thinnest, then silver, straw, gold,
 * magenta, blue, and the softer pinks and greens of the higher orders.
 *
 * The thickness is a simulated fluid. The film drains under gravity (thin at
 * the top, thick at the bottom), thin patches are born at the edges and rise

  // ---------------------------------------------------------------
  // Full source available with a viberdy Pro subscription.
  // https://viberdy.dev/pricing
  // ---------------------------------------------------------------
}
Details

Pairs well with

Pro

Ink Aura Field

backgrounds
Pro
Trending
Pro