# Plasma Ball — `plasma-ball@1.0.0`

A plasma globe: filaments of electric light writhe from a white-hot core and gather to a finger on the glass. Loops perfectly.

A plasma globe on a black glossy base in a dark room: a white-hot electrode at its heart, filaments of violet light that writhe from it to the glass and jump to new paths several times a second, a bright tip where each one meets the glass, a haze that fills the sphere, and a glow that spills over the base and the table. Part-way through, a finger touches the glass and the filaments reach for the spot, then let go again. Choose the colour (violet and pink, cyan and blue, rose and amber, green and aqua), the number of filaments, the strength of the glow, whether a finger touches it, and the room.

- Kind: object; status: published; digest sha256:c60a3add2d9cd2ecc7d9e296b746d73f54c9e23913656aac86699a915ec888ec
- Role: Hero object (Three.js 3D): an electric, sci-fi plasma globe for tech, energy and retro-science content.
- Implementation: three; entry `src/plasma-ball.js`
- Files: https://aipixelwizard.com/registry/plasma-ball/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/plasma-ball.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/plasma-ball/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/plasma-ball/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 the ribbon, tip and haze shaders.; `chrome-material@1.1.0` (demo) — Studio environment light, backdrop and contact shadow.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createPlasmaBall({ color?, filaments?, seed? }) => { group, sphere, height, uniforms, update(time, loopSeconds, camera?, { touch?, point? }), dispose() }` — The globe as a THREE.Group (1 unit = 10 cm, standing on y = 0): base, stem, haze, filaments, the glass reflection layer. update(time, loopSeconds) is a pure function of time; touch (0…1) and point (a direction from the globe's centre) draw the filaments to a finger.
- `createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }` — Draws the scene into a half-float target, blurs its bright parts at three scales and composites them with filmic tone mapping and a fixed grain.
- `PALETTES: { violet, cyan, rose, green }` — The colourways: core, glow and halo colours.

## Parameters
- `color` (select one of violet | cyan | rose | green, default "violet") — Colour
- `filaments` (integer 6–24, default 14) — Filaments
- `touch` (boolean, default true) — Finger on the glass
- `glow` (number 0.4–1.8, default 1) — Glow
- `room` (color, default "#07060c") — Room colour
- `table` (color, default "#0e0d12") — Table
- `seed` (integer 1–999, default 3) — Seed: Changes the paths the filaments take.

## Composition
- Inputs: Time within the loop; the colour, filament count, touch and glow.
- Outputs: A THREE.Group (base, stem, haze, filaments, glass layer) that createBloomPass draws with its glow.
- Coordinates: 1 unit = 10 cm. The sphere has a radius of 2 and is centred 2.75 above the table; the base is 3.6 across.
- Lighting: Physical glossy base and a reflection-only glass layer: needs scene.environment. Add a point light in the glow colour near the base to wash it and the table.
- Timing: update(time, loopSeconds) is a pure function of time; frames render in any order.
- Works with: chrome-material, kinetic-title, particle-tunnel
- The filaments are glowing ribbons built in the vertex shader; there are no per-frame uploads.
- The glass is drawn additively as pure reflection, so the glow inside stays visible through it.

## Output and loop
- 1080×1080, 30 fps, 12 s, procedural
- Seamless loop: yes — The filaments' paths come from a hash of the flicker step, taken modulo a whole number of steps per loop, so the flicker repeats exactly; the finger arrives and leaves within the loop and the camera drift is a sine of it, so the last frame meets the first.
- Verified 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)); deterministic: yes; loop check: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.

## Use it
New project: Set scene.environment (createStudioEnvironment from Chrome Material works), add createPlasmaBall().group and a point light, and call update(time, loopSeconds, camera, { touch, point }) then bloom.render(scene, camera) each frame.

Existing project: Copy src/plasma-ball.js. Add the group to your scene, and draw it with createBloomPass or your own bloom so the filaments glow.

Reuse ideas:
- Tech opener: Violet, with a touch, with your title above the globe.
- Energy theme: Green, wild, behind a counter or a chart.
- Retro science: Rose and amber with a brass-toned table.

## Limitations
- The filaments reach the glass straight from the electrode; they do not fork.
- The finger is shown only as a bright spot on the glass and the filaments reaching for it, not as a hand.

## License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.
- three.js 0.185.1: MIT (https://github.com/mrdoob/three.js)

Provenance: Adapted from the owner's threejs-sketches/light-atmosphere/plasma-globe (MIT), rebuilt for AI Pixel Wizard in October 2026: a modelled globe on a glossy base, filament ribbons whose flicker is a looped hash of the step, tips, haze and a bloom, a finger that draws the filaments, four colourways and the frame/time contract.

