# Hawking Radiation — `hawking-radiation@1.0.0`

Particle pairs flash out of the vacuum at a black hole's horizon: one escapes, one falls in, and the hole shrinks. Loops perfectly.

A black hole that slowly gives itself away. Pairs of virtual particles flash into being just outside the horizon; in each pair one partner is pulled in and fades (cold magenta), the other escapes along a spiral carrying its energy away (bright cyan), and the hole, which paid for it, shrinks a little. A glowing photon ring, a streaked accretion disc and a halo mark the horizon against a field of stars. Choose the number of pairs, the colours (classic, ice, ember or mono), how many times each pair is born per loop, how much the hole shrinks, the seed and whether the camera sways.

- Kind: background; status: published; digest sha256:88ce05bf5ac14ebfd697972f905763e0f45ee8ce33b6a5d3a203de82fd5371e5
- Role: Scene (3D, three.js): a cosmic physics showpiece for science, space and sci-fi content.
- Implementation: three; entry `src/hawking-radiation.js`
- Files: https://aipixelwizard.com/registry/hawking-radiation/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/hawking-radiation.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/hawking-radiation/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/hawking-radiation/1.0.0/index.html (open over http; it imports sibling packages by relative path)
- Dependencies (exact): `three@0.185.1` (source) — Renderer, geometry and shader materials.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createBlackHole({ pairs?, palette?, cycles?, shrink?, seed? }) => { group, setProgress(progress), dispose() }` — The black hole with its photon ring, disc, halo, star field and particle pairs; horizon radius 2; render through createBloomPass.
- `createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }` — A small bloom with an anti-aliased, depth-tested scene target.
- `PALETTES: { classic, ice, ember, mono }` — Colours for escaping and infalling particles, the disc and the photon ring.

## Parameters
- `pairs` (integer 16–140, default 64) — Particle pairs
- `palette` (select one of classic | ice | ember | mono, default "classic") — Colours
- `cycles` (integer 1–3, default 2) — Births per loop
- `shrink` (number 0–2, default 1) — Shrinking
- `seed` (integer 1–999, default 7) — Seed
- `orbit` (boolean, default true) — Camera sway

## Composition
- Inputs: Time within the loop; the pairs, colours, births per loop, shrinking, seed and camera sway.
- Outputs: A full frame rendered in 3D through an anti-aliased bloom.
- Coordinates: The horizon (radius 2) is centred on the origin; the disc is tilted 16° and reaches to 7.6; stars sit on a sphere of radius 55–65; the camera sits 22 away.
- Lighting: Self-lit additive particles, ring and disc; the bloom gives the glow.
- Timing: setProgress(progress) places every particle from its pair's phase; frames render in any order.
- Works with: kinetic-title, number-reveal
- Each pair has two particles with four trail ghosts each; the hole's scale shrinks by up to 14% at the middle of the loop and returns.

## Output and loop
- 1080×1080, 30 fps, 16 s, procedural
- Seamless loop: yes — Each particle pair is born a whole number of times per loop and is a function of its pair's phase, the disc streaks turn whole cycles per loop, the shrinking is a cosine of the loop and the camera sway is a sine of the loop, so the last frame meets the first.
- Verified 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)); 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, createBlackHole() and createBloomPass(renderer, { width, height }); each frame call hole.setProgress(progress) and bloom.render(scene, camera).

Existing project: Copy src/hawking-radiation.js; add hole.group to your scene and render it through createBloomPass.

Reuse ideas:
- Space explainer: Cyan and magenta.
- Cold sci-fi: Ice, many pairs.
- Dramatic: Ember, slow.

## Limitations
- The hole shrinks and then regrows within the loop; real evaporation is far slower and does not reverse.
- The disc is a stylised glowing ring, not a ray-traced lensed image.

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

Provenance: Adapted from the owner's threejs-sketches/physics-forces/hawking-radiation (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original scene: paired particles born at the horizon along a closed-form escape spiral and infall, a streaked accretion disc and a bloom, on an exact loop.

