# Voronoi Cells — `voronoi-cells@1.0.0`

A field of glowing cells with bright veins between them and a nucleus in each, drifting on closed orbits like cells under a microscope. Loops perfectly.

A field of glowing cells, like cells under a microscope or the cracks in dried mud lit from beneath. Seed points drift on small closed orbits; every pixel finds its nearest and second-nearest point, so each cell is filled with a soft gradient, the borders between cells glow as thin bright veins, and every point has a bright nucleus. Each point makes whole orbits per loop, so it repeats seamlessly. Choose how many cells fit across the picture, the colours (ember, ocean, moss or mono), how far the points travel, how bright and thin the veins are and the seed.

- Kind: background; status: published; digest sha256:dec4d650a270448ee8602583d0d297913324a368ebd037924d25169ade03a43b
- Role: Shader background (three.js): a living, organic backdrop for science, wellness and tech content.
- Implementation: three; entry `src/voronoi-cells.js`
- Files: https://aipixelwizard.com/registry/voronoi-cells/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/voronoi-cells.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/voronoi-cells/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/voronoi-cells/1.0.0/index.html (open over http; it imports sibling packages by relative path)
- Dependencies (exact): `three@0.185.1` (source) — Renderer and a full-screen shader material.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createVoronoiCells({ scale?, palette?, orbit?, veins?, seed? }) => { scene, camera, setSize(width, height), update(time, loopSeconds), dispose() }` — The cells as one full-screen shader; render its scene with its camera, ideally through createBloomPass.
- `createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }` — A small bloom with tone mapping and a fixed grain.
- `PALETTES: { ember, ocean, moss, mono }` — Cell, vein and nucleus colours.

## Parameters
- `scale` (number 3–14, default 6) — Cells across
- `palette` (select one of ember | ocean | moss | mono, default "ember") — Colours
- `orbit` (number 0–1.5, default 1) — Drift
- `veins` (number 0.4–2, default 1) — Veins
- `seed` (integer 1–999, default 3) — Seed

## Composition
- Inputs: Time within the loop; the cell count, colours, drift, veins and seed.
- Outputs: A full-frame shader image through a bloom pass.
- Coordinates: Screen-centred, ±1 vertically, scaled by the cell count; one seed point per grid cell.
- Lighting: Self-lit; the bloom gives the glow.
- Timing: update(time, loopSeconds) sets the loop phase; frames render in any order.
- Works with: kinetic-title, number-reveal
- Each pixel looks at the nine nearest grid cells; points stay inside their cell's neighbourhood, so there are no seams.

## Output and loop
- 1080×1080, 30 fps, 10 s, procedural
- Seamless loop: yes — Every point makes a whole number of laps of its orbit per loop, so the last frame meets the first.
- Verified 2026-10-08 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)); deterministic: yes; loop check: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.

## Use it
New project: Create a WebGLRenderer, createVoronoiCells() and createBloomPass(renderer, { width, height }); call cells.setSize(w, h) and each frame cells.update(time, loopSeconds) then bloom.render(cells.scene, cells.camera).

Existing project: Copy src/voronoi-cells.js and render cells.scene with cells.camera into your own target.

Reuse ideas:
- Biotech title: Ember cells.
- Calm science: Ocean, fine.
- Organic: Moss, big and slow.

## Limitations
- Fine, bright veins on moving cells can shimmer when compressed to small video sizes.
- Cells are 2D and flat; there is no depth.

## License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.

Provenance: Original code written for AI Pixel Wizard in October 2026, to the catalog quality bar (docs/QUALITY.md).

