# Liminal Corridor — `liminal-corridor@1.0.0`

An empty corridor under buzzing fluorescent lights, one flickering, the camera creeping down it. Loops perfectly.

The uncanny emptiness of a corridor at night: rows of fluorescent ceiling panels running away into the haze, their light pooling on the walls and gleaming in the floor, doors along the walls and nobody there, while the camera creeps slowly forward and one tube on a faulty circuit flickers. Choose the place: the Backrooms (mono-yellow wallpaper, damp carpet, a yellow haze), an office at night (grey walls, wooden doors, glossy vinyl tiles) or a hospital ward (pale green walls, a handrail, a white floor), how badly the tube flickers, and the exposure.

- Kind: background; status: published; digest sha256:10295ac2509bf13585d28f564c2b3f17662d1d0902ad362c8b696357bfc4aa74
- Role: Background (WebGL shader, full frame): an eerie liminal-space loop for horror, mystery and internet-culture content.
- Implementation: three; entry `src/liminal-corridor.js`
- Files: https://aipixelwizard.com/registry/liminal-corridor/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/liminal-corridor.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/liminal-corridor/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/liminal-corridor/1.0.0/index.html (open over http; it imports sibling packages by relative path)
- Dependencies (exact): `three@0.185.1` (source) — Renderer and the full-screen shader.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createLiminalCorridor({ style?, flicker?, seed?, exposure? }) => { scene, camera, material, spacing, setSize(width, height), update(time, loopSeconds), dispose() }` — The corridor as one full-screen shader: render its scene with its camera after setSize and update. The camera walks four panels per loop.
- `faultyTube({ loopSeconds, flicker?, seed? }) => (time) => brightness` — The faulty tube's brightness over a loop (seeded flicker and dropouts), for syncing a buzz or a scare.
- `STYLES: { backrooms, office, hospital }` — The three places: light, wall, floor, ceiling, trim, haze and door colours, and floor gloss.

## Parameters
- `style` (select one of backrooms | office | hospital, default "backrooms") — Place
- `flicker` (number 0–1, default 0.5) — Faulty light: How badly one tube in four flickers.
- `exposure` (number 0.5–1.6, default 1) — Exposure
- `seed` (integer 1–999, default 2) — Seed: Changes when the tube flickers, and the stains and wear.

## Composition
- Inputs: Time within the loop; the place, flicker, exposure and seed.
- Outputs: A full frame, drawn by one shader on a full-screen quad.
- Coordinates: Metres: the corridor is 2.4 wide and 2.7 high, panels every 3; the camera is at eye height, 1.62.
- Lighting: Self-contained: exact diffuse light from each panel, a glossy floor reflection and soft halos.
- Timing: update(time, loopSeconds) is a pure function of time; frames render in any order. faultyTube gives the flicker for syncing sound.
- Works with: kinetic-title, stop-motion-feel, dither-animation
- One tube in four is on the faulty circuit, so they flicker together, as tubes on one circuit do.
- The corridor has no end: it runs into haze.

## Output and loop
- 1080×1080, 30 fps, 12 s, procedural
- Seamless loop: yes — The camera walks exactly four panels per loop and the lights repeat every four panels; the flicker is scheduled round the loop and the camera's sway is whole cycles, 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.0003, max |Δ| 1 of 255.

## Use it
New project: Create a WebGLRenderer, createLiminalCorridor(), call setSize with the canvas size, then each frame update(time, loopSeconds) and renderer.render(corridor.scene, corridor.camera).

Existing project: Copy src/liminal-corridor.js and render it into a render target to use as a backdrop or a screen in your scene.

Reuse ideas:
- Horror opener: The Backrooms with a title that appears only while the tube is out (sync with faultyTube).
- Analogue horror: Office at night under Dither Animation or Stop-Motion Feel for a found-footage look.
- Podcast background: Hospital ward, failing light, behind a story.

## Limitations
- The corridor is straight and endless: no turns, side passages or furniture.
- Light does not cast shadows of the door frames.

## 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/fluorescent-corridor (MIT), rebuilt for AI Pixel Wizard in October 2026 as one analytic shader: exact area lighting from the ceiling panels, a glossy floor reflection, three places (the Backrooms, an office, a hospital) with doors, trims and stains, a faulty tube, a looping walk and the frame/time contract.

