Skip to content

Hypnotic Spiral

A tunnel of spiralling colour bands rushing inwards with glowing edges and cycling colours. Loops perfectly.

Background, V1 Effects3DSeamless loop, verified232 lines of codev1.0.0

In Light, glass & shine, Patterns & illusions

Next: Voronoi CellsSurprise me

Hypnotic Spiral 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

5
1

Whole turns of the swirl per loop; negative reverses it.

3

Bands passing per loop.

1

Whole trips round the colour ramp per loop.

1
1

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

Info

What it is

A tunnel of spiralling bands that pulls the eye down into the centre. The arms of the spiral sweep round, the bands race inwards in perspective and the colours cycle through a ramp while a glowing edge rides each arm. The swirl, the rush and the colour cycle each complete whole turns per loop. Choose the number of arms, the colours (candy, fire, ocean or mono), the swirl, the rush, the colour cycle, the twist of the tunnel and the ring density.

Reuse it in your own idea

  • Music visual: Candy, five arms.
  • Dramatic transition: Fire, reverse swirl.
  • Calmer: Ocean, many arms.

Which part is reusable

src/hypnotic-spiral.js is the ingredient your AI reuses. demo.js is only the example scene around it, and uses the demo harness only for the demo.

Good to know

  • Strobing patterns of this kind can be uncomfortable for some viewers; keep the rush low for sensitive audiences.
  • The centre is darkened rather than resolving into a point.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/hypnotic-spiral.js
Exports
  • createHypnoticSpiral({ arms?, palette?, swirl?, rush?, cycle?, depth?, bands? }) => { scene, camera, setSize(width, height), update(time, loopSeconds), dispose() }
  • createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }
  • PALETTES: { candy, fire, ocean, mono }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer and a full-screen shader material.
  • apw-runtime@1.0.0 (demo) — Demo harness.
How it fits a scene

Coordinates: Screen-centred, ±1 vertically; the tunnel's axis points into the screen at the centre; distance down it is 0.35 / radius.

Lighting: Self-lit; the bloom gives the glow.

Timing: update(time, loopSeconds) sets the loop phase; frames render in any order.

Output
1080×1080, 30 fps, 12 s · procedural (computed from the frame number) · seamless loop — The swirl, the rush and the colour cycle are whole numbers of turns per loop and the arms count is whole, so the last frame meets the first.
Tested
Rendered 360 frames on 2026-10-06 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
One full-screen fragment shader with a handful of trigonometric calls, plus the bloom: about 2 ms a frame at 1080² 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 -- hypnotic-spiral/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:7e58a6f908e2d2c3…
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/shaders-backgrounds/hypnotic-spiral (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original shader: twisted perspective bands with whole-turn swirl, rush and colour cycle on an exact loop.
BinMore like this

String Art

Background3DSeamless loop12 seconds