Skip to content

Emulsion Separate

A glass of oil on water: glossy beads rise, flatten into the oil and send ripples across the boundary while water beads sink. Loops perfectly.

3D object, V2 Objects3DSeamless loop, verified145 lines of codev1.0.0

In Light, glass & shine, Liquids

Next: FerrofluidSurprise me

Emulsion Separate preview
Starting live preview…
00:00:00:00 / 00:00:00:01

Live, running the real source at reduced resolution.

Your current settings go with it. Combine several clips and hand them over together from your sequence.

Effect controls

Presets

20
1
1
5

The preview runs the same code your AI receives. These settings travel with the hand-off.

Info

What it is

A tall glass holding a layer of oil on top of water, forever separating. Glossy beads of oil are born at the bottom, swell, race up through the water and flatten into the oil layer, each merge sending a ring of ripples across the boundary between the liquids, while beads of coloured water sink through the oil and merge into the water below. Choose the number of beads, the colours (amber, rose or neon), how many trips each bead makes per loop, the strength of the ripples, the seed, the backdrop colour and whether the camera sways.

Reuse it in your own idea

  • Calm loop: Amber on blue.
  • Pastel cosmetic: Rose and mint, many.
  • Party: Neon, two trips.

Which part is reusable

src/emulsion-separate.js is the ingredient your AI reuses. demo.js is only the example scene around it, and uses chrome-material only for the demo.

Good to know

  • Beads follow fixed paths; they do not collide or merge with each other.
  • The liquids are tinted transparent bodies, not refractive.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/emulsion-separate.js
Exports
  • createEmulsion({ beads?, palette?, cycles?, ripples?, seed? }) => { group, setProgress(progress), dispose() }
  • PALETTES: { amber, rose, neon }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer, geometry and shader materials.
  • chrome-material@1.1.0 (demo) — Studio environment light, backdrop and contact shadow.
  • apw-runtime@1.0.0 (demo) — Demo harness.
How it fits a scene

Coordinates: The glass is centred on the y axis with radius 1.7 and height 6.2; the boundary between the liquids sits at y = 2.6; the camera looks at the middle of the glass.

Lighting: A warm key light with a shadow map and the studio environment.

Timing: setProgress(progress) places every bead and rewrites the boundary; frames render in any order.

Output
1080×1080, 30 fps, 16 s · procedural (computed from the frame number) · seamless loop — Every bead's position, size and squash is a function of the loop phase and its fixed offset, and each bead makes a whole number of trips per loop; ripples are functions of the time since a merge, so the last frame meets the first.
Tested
Rendered 480 frames on 2026-10-05 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)). Same frame twice from fresh pages: identical. Loop: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.
Performance
Two instanced bead sets and a boundary mesh of about 3 500 vertices rewritten each frame: a couple of milliseconds a frame on an integrated Intel GPU. Software WebGL renders in about two seconds a frame.
Export a video yourself
Download the source, then in the folder: npm install npm run render -- emulsion-separate/1.0.0 --out my-video.mp4Needs Node 18+, ffmpeg and Chrome/Chromium. Add --params my-settings.json (from Copy settings) for your own settings.
Version
1.0.0 · sha256:d9b624d2db2f52eb…
Files
License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder. License details
Provenance
Adapted from the owner's threejs-sketches/physics-forces/emulsion-separate (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original studio object: periodic beads rising and sinking through two tinted liquids, with ring ripples on the boundary from each merge, on an exact loop.
BinMore like this

Ferrofluid

3D object3DSeamless loop16 seconds

Lava Lamp

3D object3DSeamless loop15 seconds

Resin Pour

3D object3DSeamless loop14 seconds

Soap Film

3D object3DSeamless loop12 seconds