Skip to content

Candle Flame

A candle burning in the dark: a living flame, glowing wax, a melted crater, one gust and it recovers. Loops perfectly.

3D object, V2 Objects3DSeamless loop, verified454 lines of codev1.0.0

In Nature & weather, Spooky & Halloween

Next: ThunderstormSurprise me

Candle Flame 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

How far the one gust in the loop bends the flame.

1
1.15
3

Changes the rim, the drips and the flicker's pattern.

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

Info

What it is

A candle burning in a dark room, close in: a wax pillar (or a tall taper, or a cluster of three) with a melted crater and drips down its side, a wick with its ember, a brass dish, and a flame that licks and sways, blue at the foot, a bright yellow body, an orange edge and a dark cone round the wick. The wax glows from within near the top and the flame lights the dish, the table and the air round it, flickering with it. Once in the loop a gust bends the flame over and it recovers. Choose the candles, the wax colour, the flame (warm, gold, classic or rose), how restless the flame is, how strong the gust, the glow and the exposure.

Reuse it in your own idea

  • Cosy story: Pillar candle behind a handwritten-style title.
  • Remembrance: Golden taper, slow, with a name and a date.
  • Birthday or holiday: Three candles, camera drift on.

Which part is reusable

src/candle-flame.js is the ingredient your AI reuses. demo.js is only the example scene around it, and uses chrome-material only for the demo.

Good to know

  • The flame is a 2D billboard turned to the camera: it does not have a real volume and looks flat from a very low angle above.
  • The wax does not melt over the loop; the crater and drips are fixed.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/candle-flame.js
Exports
  • createCandles({ layout?, wax?, flame?, flicker?, gust?, seed? }) => { group, height, dish, update(time, loopSeconds, camera), dispose() }
  • createBloomPass(renderer, { width, height, glow?, exposure?, grain? }) => { render(scene, camera, output?), dispose() }
  • LAYOUTS: { pillar, taper, cluster }
  • FLAMES: { warm, gold, candle, rose }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer, geometry, point lights and the flame shader.
  • chrome-material@1.1.0 (demo) — Studio environment light and the room backdrop.
  • apw-runtime@1.0.0 (demo) — Demo harness.
How it fits a scene

Coordinates: 1 unit = 10 cm. A pillar is 3 wide and 5 tall; the flame is 3.1 tall; the dish stands on y = 0.

Lighting: The flame lights everything through a point light in its colour (with shadows from the tallest); the wax carries its own warm emission near the top. Needs scene.environment only for the brass.

Timing: update(time, loopSeconds, camera) 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 flame's tongues are waves running up it with a whole number of cycles per loop, its brightness and height flicker in whole cycles, and the gust is a single bump well inside 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
A few hundred triangles of wax and a procedural flame quad per candle, one shadow-casting point light and a small bloom chain. Smooth at 1080p on laptop GPUs. Software WebGL (no GPU) renders slowly; point-light shadows are the main cost.
Export a video yourself
Download the source, then in the folder: npm install npm run render -- candle-flame/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:e785a6beabf9f591…
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/webgpu-candle-flame (objects-scenes, MIT), rebuilt for AI Pixel Wizard in October 2026 in WebGL: a procedural flame shader (blue foot, dark cone, tongues running up it in whole loop cycles), a modelled candle with a melted crater, drips, a wick and a brass dish, glowing wax, a flickering light that casts shadows, a gust, a bloom and the frame/time contract.
BinMore like this

Zen Garden

Background3DSeamless loop20 seconds

Snowfall

Effect2DSeamless loop10 seconds