Procgen Effects Showcase
- ..
- .metadata253 B
- README.md2.4 KB
- preview.png16.1 KB
- properties.yaml372 B
- shader.wgsl5.0 KB
README.md
wf_pool
Plunge-pool water: travelling ripples, churn turbulence that grows toward the impact, a two-phase
radial foam flow, depth-driven shore and rock foam, a fresnel sky reflection and sun glitter. All
positions are taken relative to the waterfall origin (origin_x, origin_z) on the world XZ plane.
The surface normal sums four travelling sine waves, rings running outward from the impact point, and
an fx_noise fBm chop whose strength rises with the churn, a Gaussian falloff of distance from the
impact over churn_radius. The water colour comes from the depth already drawn underneath
(zero_scene_depth_fade): light teal where the bed is close, dark blue-green where it is deep. Over
that it mixes a sky gradient from a horizon (0.62, 0.76, 0.92) to a zenith (0.18, 0.34, 0.66) by
a Schlick fresnel term, and adds two lobes of sun glitter, stronger in the churn. Foam is drawn from
two flow phases advected outward from the impact and cross-faded so the cycle loops smoothly, plus
the churn itself, a spread term around the impact, ragged contact foam where the water meets rock or
shore (a depth fade over 0.42), fine breakup noise and worley lace cells. The foam colour is a lit
white, mixed in by foam. The alpha runs from 0.55 at the shore to 1 in deep water, raised by the
foam.
Two materials use it, both alpha-blended with culling off and depth writes off, and the wf_water
graph (waterfall/wf_water.procGraph) draws both in the Procgen Effects Showcase world's fx_falls scene: wf_pool_mat on the 21 by
18.5 plunge pool (origin z 42, impact at (0, -3.5), churn_radius 3.7, foam 1), and
wf_river_mat on the 7.2 by 13 river above the lip (origin z 42, impact at (0, 60), churn_radius
3, foam 0.55).
The shader includes fx_noise and zero::scene_depth.
Properties
| Property | Type | Default | Meaning |
|---|---|---|---|
origin_x | float | 0 | World X of the waterfall origin; positions are measured from it. |
origin_z | float | 0 | World Z of the waterfall origin. |
impact_x | float | 0 | X of the plunge point, relative to the origin. |
impact_z | float | -3.4 | Z of the plunge point, relative to the origin. |
churn_radius | float | 3.6 | Radius of the churned water around the plunge point (range 0.5 to 20). |
foam | float | 1.0 | How strongly the foam is mixed over the water (range 0 to 2). |