Skip to content

Kaleidoscope Tunnel

A tunnel lined with kaleidoscope mirrors: petals bloom in mirrored wedges and race towards you in rainbow colours. Loops perfectly.

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

In Light, glass & shine, Patterns & illusions

Next: Voronoi CellsSurprise me

Kaleidoscope Tunnel 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

8
1

Whole wedges the pattern turns per loop; negative reverses it.

3

Rings passing per loop.

1

Whole trips round the colour ramp per loop.

1

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

Info

What it is

A tunnel lined with kaleidoscope mirrors. Round the tunnel the picture is folded into mirrored wedges, down it the pattern repeats in rings that race towards you, and in every cell of the pattern a bloom of petals opens in colours that slide through the rainbow. The wedges turn by whole wedges, the rings pass in whole numbers and the colours make whole trips per loop. Choose the number of wedges, the colours (rainbow, neon, fire or ocean), the swirl, the rush, the colour cycle and the number of rings.

Reuse it in your own idea

  • Party visual: Rainbow, eight wedges.
  • Club: Neon, twelve wedges.
  • Calmer: Fire, slow.

Which part is reusable

src/kaleidoscope-tunnel.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

  • Fast kaleidoscopic motion 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/kaleidoscope-tunnel.js
Exports
  • createKaleidoscopeTunnel({ segments?, palette?, swirl?, rush?, cycle?, density? }) => { scene, camera, setSize(width, height), update(time, loopSeconds), dispose() }
  • createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }
  • PALETTES: { rainbow, neon, fire, ocean }
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.42 / 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 pattern turns by whole wedges, the rings pass in whole numbers, the colours make whole trips round their ramp and the wedge count is even, 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 few trigonometric calls and two pattern layers, 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 -- kaleidoscope-tunnel/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:245b62120ecfb44e…
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/kaleidoscope-tunnel (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original shader: mirrored wedges with petal cells repeating down a perspective tunnel, whole-wedge swirl, whole-ring rush and whole-trip colour cycle, on an exact loop.
BinMore like this

String Art

Background3DSeamless loop12 seconds