storm_ground
Surface shader for sodden ground: churned earth, rock, puddles with animated rain rings, and the lightning bolt's reflection in the pools (`flash`, `bolt_pos`). Everything is computed from the world XZ position in a `surface()` function that fills a `PbrSurface`.
storm_ground
Surface shader for sodden ground: churned earth, rock, puddles with animated rain rings, and the
lightning bolt's reflection in the pools (flash, bolt_pos). Everything is computed from the
world XZ position in a surface() function that fills a PbrSurface.
A height field of PCG-hashed value-noise fBm gives the relief and its normal, which flattens out
between 40 and 160 units from the camera. Puddles fill the low ground, clustered by a broad noise,
scaled by wet and puddles; they fade in across a square band 9 to 16 units out from (center_x,
center_z), leaving drier ground around the keep standing there. Two layers of rain rings (cells 0.55 and
0.83 wide, 1.15 and 0.85 drops per cell per second) bend the normal on every wet patch, most
strongly in the pools. The albedo mixes dark earth, grey rock patches and dead grass, is darkened by
wet, and goes near-black in the pools; roughness runs from 0.72 dry to 0.30 wet and 0.03 in the
pools, and reflectance is 0.55.
The strike's reflection traces the reflected view ray toward the vertical column above bolt_pos
and adds a blue-white streak (0.55, 0.66, 1.0) in the pools, scaled by a fresnel term and by
flash. Distance haze 1 - exp(-distance * fog) fades the ground into the colour (0.052, 0.066, 0.092), the same haze colour storm_sky puts on its horizon, brightened slightly by the flash.
The storm_ground material (storm/materials/storm_ground.material) sets (center_x, center_z)
to (-100, 220), where the keep stands, and keeps the defaults for the rest; the fx_storm scene's
ground draws with it. The StormDirector component writes the
material's flash and bolt_pos whenever the strike lighting changes.
Properties
| Property | Type | Default | Meaning |
|---|---|---|---|
wet | float | 0.95 | How soaked the ground is, 0 to 1: darkens the albedo, lowers roughness, deepens the puddles. |
puddles | float | 1.0 | Amount of standing water, 0 to 1. |
flash | float | 0.0 | Current strike brightness (range 0 to 20). |
bolt_pos | float4 | [0, 0, 0, 0] | xyz: world position of the strike target; the reflection traces toward the column above its XZ. |
fog | float | 0.011 | Distance haze density (range 0 to 0.1). |
center_x | float | 0.0 | World X of the keep the dry apron surrounds. |
center_z | float | 0.0 | World Z of the keep the dry apron surrounds. |
Scoped to this part · feeds back into the world's score.