Log inGet started
World

Procgen Effects Showcase

Branchmain
Branchesmain
Commit99ff90d12c

README.md

storm_sky

Sky material for the lightning storm in the fx_storm scene. Loaded on its own, the scene's entrypoint makes it the sky (a temporary StormSky entity with a Skybox); as an overlay on the main scene, the main scene's sky stands. The StormDirector component on the storm entity resolves it by name and, on each frame where the strike light changes, writes flash (the summed strike flash times 1.1 plus the afterglow times 0.6) and bolt_dir (the direction from the camera drawing the viewport toward the top of the strongest current strike, with that top's height scaled by 0.6).

Shader: storm_sky (storm/shaders/storm_sky.shader), a sky-domain shader. Its header: a boiling storm deck, with two layers of domain-warped cloud drifting with the wind over a bruised, near-black gradient and a cold haze on the horizon. Every lightning strike lights the deck from inside: flash is the strike brightness and bolt_dir the direction the bolt leaves the cloud, so the cloud glows brightest around the fork, silvers the thin edges and silhouettes the thick masses in front of it.

Render state (the render block of mat.yaml): cull: none, depth_write: false.

Properties

mat.yaml sets only the shader and render state. Every property takes the shader default, and the director writes two of them at runtime:

  • flash 0.0 (range 0 to 20): brightness of the light inside the deck, written by StormDirector.
  • bolt_dir (0, 1, 0, 0): direction of the bolt from the viewer, written by StormDirector; the glow centres on it.
  • wind 1.0: multiplier on the speed the cloud layers drift.
  • exposure 1.0: multiplier on the final sky colour.