Progress
Loading, upload, build: the hatched rail that fills.
- Drawn with
- WebGL
- Chain
- constant → pixelate → ordered → hatch → hatch → palette
- Code
- @forgeron/shaders: builtInPresets()["role-progress"]
/01 → What it is
- The filled part drifts in diagonal hatch, the rest of the rail is a sparse hatch; the area is a rectangle of the frame.
- The same hatched stripes as the rails of the landing, moving.
/02 → Where Forgeron uses it
| Site | Where | Settings |
|---|---|---|
| Gallery | This page (not yet on a site) | built-in preset |
/03 → Versions
- /01 Live
every setting of its hatch pass
/04 → Use it
{
"$schema": "https://shaders.forgeron.sh/schema/preset.v1.json",
"version": 1,
"name": "role-progress",
"source": {
"type": "constant",
"value": 0
},
"passes": [
{
"type": "pixelate",
"size": 4
},
{
"type": "ordered",
"matrix": 8,
"centered": true,
"origin": "top",
"steps": [
[
0,
1
]
]
},
{
"type": "hatch",
"tone": 2,
"over": [
0
],
"period": 5,
"width": 2,
"speed": 8,
"direction": "down",
"x0": 0.08,
"x1": 0.6,
"y0": 0.4,
"y1": 0.6
},
{
"type": "hatch",
"tone": 1,
"over": [
0
],
"period": 4,
"width": 1,
"speed": 0,
"direction": "down",
"x0": 0.6,
"x1": 0.92,
"y0": 0.4,
"y1": 0.6
},
{
"type": "palette",
"tones": [
{
"var": "--bg",
"fallback": "#0d0d0d"
},
{
"var": "--line-strong",
"fallback": "#3a1708"
},
{
"var": "--ink-dim",
"fallback": "#8a3508"
}
],
"transparent": [
0
]
}
]
}import { builtInPresets } from "@forgeron/shaders";
import { mountPreset } from "@forgeron/shaders/dom";
// WebGL2: every step has GLSL. Validated first.
const handle = mountPreset(canvas, builtInPresets()["role-progress"]);
// 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()["role-progress"]), 320, 200, { time: 1.7 }));API → Options
| Option | Type | Default | Description |
|---|---|---|---|
tone | number | 1 | Tone of the stripes. |
over | number[] | [0] | Tones the stripes may cover. |
period | number | 4 | Cells between two stripes. |
width | number | 2 | Cells of a stripe. |
speed | number | 0 | Cells per second. |
direction | "down" | "up" | "down" | Lean of the stripes. |
x0 | number | 0 | Left edge of the area. |
x1 | number | 1 | Right edge of the area. |
y0 | number | 0 | Top edge of the area. |
y1 | number | 1 | Bottom edge of the area. |