lightning_bolt
Additive unlit surface shader for lightning ribbons: a hot white core, a blue-violet halo, and crawling flicker along the channel. On the ribbon `uv.x` runs along the bolt and `uv.y` across it. Across the ribbon three falloffs stack: a tight white-hot core `(1.0, 0.97, 0.92)` at…
lightning_bolt
Additive unlit surface shader for lightning ribbons: a hot white core, a blue-violet halo, and
crawling flicker along the channel. On the ribbon uv.x runs along the bolt and uv.y across it.
Across the ribbon three falloffs stack: a tight white-hot core (1.0, 0.97, 0.92) at 17 times
brightness, a mid glow between the core colour and blue (0.42, 0.52, 1.0), and a wide blue halo,
all softened to zero at the ribbon's edges. Hot spots crawl along the channel from a value noise
over uv.x, the storm clock gt and the bolt's own phase. Everything is scaled by flash, the
strike envelope (0 dark, 1 the return stroke), and by gain; while flash is below 0.003 the
fragments are discarded.
The storm graph (storm/storm.procGraph) draws one forked bolt per strike in the storm schedule
with it, each as its own output and material (additive, culling off, depth writes off): flash is
that strike's envelope expression, gt the graph time, phase the strike's index, and gain is
1.0. Each bolt is a jittered, smoothed, resampled line from the strike's top to its target, branched
three generations deep by curve.branch, and drawn as two crossed ribbons 3.4 wide that thin with
each generation. In the Procgen Effects Showcase world, the fx_storm scene plays the graph.
Properties
| Property | Type | Default | Meaning |
|---|---|---|---|
flash | float | 1.0 | Strike envelope, 0 dark to 1 the return stroke (range 0 to 4). |
gt | float | 0.0 | The storm clock in seconds; drives the crawl of the hot spots. |
phase | float | 0.0 | Per-bolt offset of the crawling hot spots. |
gain | float | 1.0 | Multiplies the output (range 0 to 10). |
Scoped to this part · feeds back into the world's score.