Skip to content

God Rays Through a Door

Shafts of golden light pouring through a doorway into a dark, dusty hall, motes floating in the beam. Loops perfectly.

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

In Light, glass & shine

Next: Voronoi CellsSurprise me

God Rays Through a Door 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

1
1
3

Changes the foliage's shadows and where the dust floats.

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

Info

What it is

A dark stone hall with light pouring in through an opening at the far end into dust-filled air. The shafts are real volumetric light: the doorway's shape, the pillars' shadows and the door leaf standing in the hall all cut the beam exactly, the foliage outside dapples it and drifts, and the air glows brightest when you look straight into the light. Dust motes float in the beam and flash as they turn, the bright opening blooms, and the camera creeps slowly forward. Choose the opening (a door ajar, a four-pane window or three pointed cathedral arches), the colour of the light (golden hour, dawn rose, moonlight or white), how dusty the air is, and whether there are pillars and motes.

Reuse it in your own idea

  • Epic title: Cathedral arches with a serif title in the dark foreground.
  • Spiritual narration: Door ajar at golden hour, motes on, behind a slow voice-over.
  • Mystery: Moonlit hall under Dither Animation for a grainy, haunted feel.

Which part is reusable

src/god-rays.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

  • The hall is fixed: the opening, pillars and camera path are not parameters beyond those listed.
  • The sun's direction drifts only a little; it does not move across the sky.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/god-rays.js
Exports
  • createGodRays(renderer, { width, height, scene?, color?, haze?, columns?, motes?, intensity?, exposure?, glow?, seed? }) => { render(time, loopSeconds, output?), dispose() }
  • SCENES: { door, window, cathedral }
  • LIGHTS: { gold, dawn, moon, white }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer, the full-screen volume shader and the mote points.
  • apw-runtime@1.0.0 (demo) — Demo harness.
How it fits a scene

Coordinates: Metres: the hall is 8 wide, 7 high and 21 long; the opening is in the far wall, 12 m from the middle of the hall.

Lighting: Self-contained: exact visibility of the sun through the opening, pillars and door leaf; forward-scattering haze; a little room fill.

Timing: render(time, loopSeconds) is a pure function of time; frames render in any order.

Output
1080×1080, 30 fps, 12 s · procedural (computed from the frame number) · seamless loop — The foliage's shadows drift round a circle, the motes orbit small loops a whole number of times, the camera, the door leaf and the cloud over the sun move as sines of the loop, 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 volume pass of 52 steps (the beam's density is only evaluated where it is lit), 700 motes and a small bloom. Smooth at 1080p on laptop GPUs. Software WebGL (no GPU) renders slowly. On phones, render at 720 and scale up.
Export a video yourself
Download the source, then in the folder: npm install npm run render -- god-rays/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:5e29f486efd6b18d…
Files
License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder. Third-party: three.js 0.185.1 (MIT). License details
Provenance
Adapted from the owner's threejs-sketches/light-atmosphere/god-rays (MIT), rebuilt for AI Pixel Wizard in October 2026 as true volumetric light: analytic visibility through three openings, pillar and door shadows with growing penumbra, forward-scattering haze, dappled foliage, dust motes, bloom, and the frame/time contract.
BinMore like this

Bass Pulse

Background3DSeamless loop8 seconds

Disco Ball

Background3DSeamless loop12 seconds