Log inGet started
World

Procgen Effects Showcase

Branchmain
Branchesmain
Commit99ff90d12c

README.md

storm_sky

Sky-domain shader (@domain: sky): a drifting, domain-warped storm deck over a bruised, near-black gradient, a cold haze on the horizon, and lightning that lights the cloud from inside around bolt_dir with strength flash. Its fragment takes a SkyInput and works from the view ray's direction.

Three cloud layers are projected onto planes overhead: a high, slow far deck, a lower and quicker near deck, and fast scud, each a domain-warped value-noise fBm drifting with time at a speed set by wind. Where the cover is thick the sky goes almost black (0.006, 0.007, 0.011), where it is thin it shows a slate veil (0.060, 0.072, 0.098), and the near deck's breaks get lighter underbellies. Toward the horizon a rain-laden haze (0.052, 0.066, 0.092) takes over.

Lightning adds a blue-white (0.52, 0.62, 1.0) glow around bolt_dir: a tight core and a wider spread, passing through thin cloud and cut off by thick masses, with the cloud's mid-density edges silvered. On top of that the whole deck lifts with each stroke, more where it is thin, and the horizon brightens. Below the horizon the sky is plain haze. The result is multiplied by exposure.

The storm_sky material (storm/materials/storm_sky.material, culling off, depth writes off) uses it. The StormDirector component in the fx_storm scene resolves that material and, while the strike lighting changes, writes flash (the strike brightness times 1.1 plus 0.6 of its afterglow) and bolt_dir (the direction from the camera drawing the viewport toward the strike's top, its height scaled by 0.6).

Properties

PropertyTypeDefaultMeaning
flashfloat0.0Strike brightness lighting the deck (range 0 to 20).
bolt_dirfloat4[0, 1, 0, 0]xyz: direction from the viewer toward where the bolt leaves the cloud; normalised by the shader.
windfloat1.0Multiplies the cloud drift speed (range 0 to 8).
exposurefloat1.0Multiplies the final colour (range 0 to 8).