Procgen Effects Showcase
- ..
- .metadata269 B
- README.md3.2 KB
- preview.png2.0 KB
- properties.yaml733 B
- shader.wgsl4.4 KB
README.md
wf_sheet
Waterfall curtain: a ballistic vertex path off the lip, packet-timed ribbon noise that tears with distance fallen, aeration to white, backlit scatter and a refracted background.
The vertex stage reads each vertex's place on the sheet back from the grid's own position: u
across a 6.8-wide grid and s from 0 at the lip (base_y) to 1 at the bottom of height. It then
places the vertex on the path water takes off a lip: it leaves with out_speed and falls under
gravity (9.81), so after falling a distance s * height it has moved out_speed * t outward along
-Z from z0. The sheet widens by spread toward the bottom, sways a little more the farther it has
fallen, and is pushed along -Z by z_bias.
The fragment pins its pattern to packets of water: a packet released at time t0 has fallen 0.5 * g * (t - t0)^2, so the noise is sampled at the time each point's water left the lip. As the water
speeds up its streaks stretch, and the sheet tears into ribbons because the breakup threshold rises
with the distance fallen. Broad tongues, fine strands and grain come from fx_noise seeded by
seed. Aeration turns the water from a deep green-blue to white where the flow is thin and fast,
crests catch the sun through a Henyey-Greenstein phase (g 0.55), and the cliff behind shows through,
bent by the ripples (zero_scene_color_refract). The tail fades into the plunge over the last 7
percent and the top edge fades in at the lip.
Three materials use it, all alpha-blended with culling off and depth writes off, and the wf_water
graph (waterfall/wf_water.procGraph) hangs one curtain from each on a 6.8 by 21.5 grid in the Procgen Effects Showcase world's
fx_falls scene:
| Material | width | out_speed | spread | seed | density | z_bias |
|---|---|---|---|---|---|---|
wf_sheet_back | 9.8 | 1.45 | 0.2 | 11 | 1.1 | -0.32 |
wf_sheet_main | 9.2 | 1.7 | 0.22 | 3 | 1.15 | 0 |
wf_sheet_front | 7.6 | 1.95 | 0.26 | 27 | 0.8 | 0.34 |
All three use z0 42, base_y 21.9 and height 21.5.
The shader includes fx_noise, zero::scene_depth and zero::scene_color.
Properties
| Property | Type | Default | Meaning |
|---|---|---|---|
width | float | 6.6 | Width of the curtain at the lip (range 0.5 to 40). |
height | float | 21.5 | Height the water falls (range 1 to 80). |
z0 | float | 0 | World Z of the lip (range -1000 to 1000). |
base_y | float | 21.9 | World height of the lip (range -10 to 100). |
out_speed | float | 1.7 | Speed at which the water leaves the lip along -Z (range 0 to 8). |
spread | float | 0.22 | How much wider the curtain is at the bottom, as a fraction of width (range 0 to 1). |
seed | float | 3 | Seed for the curtain's noise and sway (range 0 to 99). |
density | float | 1.15 | Multiplies the sheet's body before it becomes alpha (range 0 to 3). |
z_bias | float | 0.0 | Shift of the whole curtain along -Z (range -3 to 3); the three curtain materials use -0.32, 0 and 0.34. |
vertexBoundsDilation | float | 3.5 | How far the vertex hook moves a vertex past the mesh, in world units: the culling bounds grow by it so a moved vertex stays inside them. |