Lobed burn
A ring of fire with drifting lobes that spreads from the centre, or closes onto it.
- Drawn with
- WebGL
- Chain
- front → pixelate → sparks → ordered → palette
- Code
- @forgeron/shaders: builtInPresets()["burn-lobed-open"]
/01 → What it is
- The picture spreads from the centre behind a lobed front whose lobes drift. Run backwards, the front closes on the centre and burns the picture away.
- The same two-ring Bayer fringe, widening from 12 px a ring at the centre to 24 near the edges.
- Embers in white and greys only, so the two burns do not look alike.
/02 → Where Forgeron uses it
| Site | Where | Settings |
|---|---|---|
| forgeron.sh | Home, the opening story: the village appears on load | burn-lobed-open · 1.9 s |
| Gallery | This page: the close direction | burn-lobed-close · not yet on a site |
/03 → Versions
- /01 Live
every setting of its front source - /02 Close
the picture burns away to the centre
/04 → Use it
import { builtInPresets } from "@forgeron/shaders";
import { mountPreset } from "@forgeron/shaders/dom";
// Progress comes from the page: the preset redraws when it is set.
const preset = builtInPresets()["burn-lobed-open"];
const handle = mountPreset(canvas, { ...preset, source: { ...preset.source, driven: true } });
addEventListener("scroll", () => handle?.set({ progress: scrollY / innerHeight }));{
"$schema": "https://shaders.forgeron.sh/schema/preset.v1.json",
"version": 1,
"name": "burn-lobed-open",
"source": {
"type": "front",
"shape": "lobed",
"direction": "open",
"cycle": 1.9,
"hold": 0.9,
"ring": 4
},
"passes": [
{
"type": "pixelate",
"size": 4
},
{
"type": "sparks",
"tick": 0.12,
"fly": 0.004
},
{
"type": "ordered",
"matrix": 4,
"centered": false,
"origin": "top",
"steps": [
[
0,
1
],
[
1.5,
0
],
[
2.5,
0
],
[
3.5,
0
]
]
},
{
"type": "palette",
"tones": [
{
"var": "--bg",
"fallback": "#0a0a0a"
},
{
"var": "--bg",
"fallback": "#0a0a0a"
},
{
"var": "--ink",
"fallback": "#ededed"
},
{
"var": "--ink-muted",
"fallback": "#ff4f1f"
},
{
"var": "--ink-dim",
"fallback": "#ff6b81"
}
],
"transparent": [
1
]
}
]
}import { builtInPresets } from "@forgeron/shaders";
import { mountPreset } from "@forgeron/shaders/dom";
// WebGL2: every step has GLSL. Validated first.
const handle = mountPreset(canvas, builtInPresets()["burn-lobed-open"]);
// later: handle?.destroy();import { builtInPresets, chainOf, runCpu, toRgba } from "@forgeron/shaders";
// The CPU side of every step: RGBA bytes for a PNG, or tone paths for an SVG (toSvgPath).
const rgba = toRgba(runCpu(chainOf(builtInPresets()["burn-lobed-open"]), 320, 200, { time: 1.7 }));API → Options
| Option | Type | Default | Description |
|---|---|---|---|
shape | "rect" | "lobed" | "rect" | A rectangle closing onto a band, or a lobed ring from the centre. |
direction | "close" | "open" | "close" | Burn the picture away, or let it in. |
progress | number | 0.5 | Progress, 0 to 1. |
cycle | number | 0 | Seconds per run; 0 holds the progress. |
hold | number | 0.9 | Seconds held. |
driven | boolean | false | Progress comes from the page (the input set while it runs). |
ring | number | 4 | Cells per ring. |
left | number | 0 | Closes onto: left (rect). |
top | number | 0.33 | Closes onto: top (rect). |
right | number | 1 | Closes onto: right (rect). |
bottom | number | 0.67 | Closes onto: bottom (rect). |
outside | "page" | "keep" | "page" | Cover what lies outside the edge, or leave it to the page. |
grow | number | 3 | Ring growth, cells (lobed). |
amp | number | 0.18 | Lobe depth (lobed). |
tick | number | 0.18 | Seconds per draw. |
offset | number | 6 | Ember depth, cells. |
wobble | number | 1 | Wave amplitude, cells. |
density | number | 0.5 | Chance, nearest layer. |
falloff | number | 0.07 | Chance lost a layer. |
fly | number | 0.003 | Flying spark chance. |
reach | number | 10 | Flight distance, cells. |
tones | number[] | [2,3,4] | Levels written: outer, middle, inner. |