# wf_water
The waterfall's water: three staggered falling curtains, the plunge pool and the river above the
lip. The curtains draw with the `wf_sheet_*` materials, whose vertex shader shapes the falling
sheet; the pool and river draw with `wf_pool_mat` and `wf_river_mat`. Its parts stand at z = 42 in
the generator's own space, and the materials state that spot too (`z0`, `origin_z`).
```lua
-- `graph` is this graph's reference: the AssetRef `asset.resolve` or a search returns for it.
local e = entity.spawn("wf_water", { position = { 0, 0, 0 } })
e.component.add("Generator", { graph = graph, playOn = "load", ending = "loop" })
```
The output `water` is one entity output holding every part. The timeline has no end and plays at
30 fps, which keeps the water's materials moving.
# wf_ground_mat
Ground material for the waterfall scene `fx_falls`. The scene's `ground` entity (a built-in cube
scaled 56 x 0.2 x 56 at (50, -0.1, 140)) wears it.
Shader: `wf_rock` (`shaders/wf_rock.shader`). Its README: world-space procedural wet rock with
strata, moss, mineral streaks, bump and spray-driven wetness, for a UV-less SDF mesh, where
`origin_*` is the waterfall's world position. From its header: rock near the falls and the pool is
dark, glossy and mossy, and dry rock above is warm and pale and banded by height; perceptual
roughness runs from 0.92 dry to 0.28 wet. `proc/wf_env.procGraph` uses the same shader for the cliff
mesh, with `bump` 0.55 and `moss` 1.0.
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `origin_x: 0`, `origin_y: 0`, `origin_z: 42`: the point the shader measures positions from; spray
wetness, the pool waterline, the seeps and the moss are placed relative to it. 42 is the `Z0`
constant `proc/wf_water.procGraph` places the waterfall at.
- `bump: 0.4`: strength of the normal perturbation from the procedural height field (default 0.55).
- `gain: 1.15`: multiplier on the albedo (default 0.75).
- `moss: 1.3`: amount of moss on upward-facing wet surfaces (default 1.0); the moss blend is clamped
to at most 0.92.
- `tint: { r: 1.25, g: 1.08, b: 0.85, a: 1.0 }`: colour multiplied into the albedo.
# wf_env_c3c73d24af2b_mat0
Material 0 of `wf_env_c3c73d24af2b`. What the `wf_env` graph made, applied from a Generator: the waterfall's cliff, plunge basin and boulders, contoured to one mesh.
# wf_env_c3c73d24af2b_mesh0
Mesh 0 of `wf_env_c3c73d24af2b`. What the `wf_env` graph made, applied from a Generator: the waterfall's cliff, plunge basin and boulders, contoured to one mesh.
# wf_spray
The waterfall's droplets: beads torn off the lip that streak down beside the falling curtain, the
plume thrown up where it lands, and the smaller drops those throw when they strike water and rock,
all one GPU solver family drawn with the `wf_particle` shader. It shares `wf_env`'s frame: the
lip runs along x at y = 21.9.
```lua
-- `graph` is this graph's reference: the AssetRef `asset.resolve` or a search returns for it.
local e = entity.spawn("wf_spray", { position = { 0, 0, 0 } })
e.component.add("Generator", { graph = graph, playOn = "load", ending = "loop" })
```
The output `spray` is every droplet. The timeline has no end and plays at 30 fps.
# wf_mist
The waterfall's mist: big soft cards born at the plunge and along the falling face, carried
outward across the pool on a gentle breeze and curl turbulence. The `wf_particle` shader draws a
rainbow inside these cards from the angle between the view ray and the point opposite the sun,
so the bow appears where it would in the real spray.
```lua
-- `graph` is this graph's reference: the AssetRef `asset.resolve` or a search returns for it.
local e = entity.spawn("wf_mist", { position = { 0, 0, 0 } })
e.component.add("Generator", { graph = graph, playOn = "load", ending = "loop" })
```
| Input | Default | What it does |
|---|---|---|
| `rainbow` | 1 | Strength of the rainbow drawn in the mist (0 to 4). |
| `density` | 0.7 | How thick the mist stands (0 to 3). |
The output `mist` is the cards. The timeline has no end and plays at 30 fps.
# wf_foam
The white boil where the waterfall lands: churning clumps of foam that heave up out of the plunge,
roll outward across the pool and burst. They are bubbly cards (the `wf_particle` shader in its
foam mode) born on a ring around the impact point at (0, -0.3, -3.5) and driven by a vortex around
it, in the frame `wf_env` sets up.
```lua
-- `graph` is this graph's reference: the AssetRef `asset.resolve` or a search returns for it.
local e = entity.spawn("wf_foam", { position = { 0, 0, 0 } })
e.component.add("Generator", { graph = graph, playOn = "load", ending = "loop" })
```
The output `foam` is the cards. The timeline has no end and plays at 30 fps.
# effectShowcase
The procedural effects of the Procgen Effects Showcase world. Each one is a `.procGraph` that plays
through a `Generator`, and every shader, material and module a graph draws with sits beside it in
this package, so the package carries everything its graphs need. Each graph's README says what it
makes, how to place it and what each of its inputs changes.
## Contents
| Folder | Graphs | What they make |
|---|---|---|
| `combat/` | `impact`, `muzzleFlash`, `tracer` | A round striking a hard surface, the bloom at a barrel as a weapon fires, and the glowing streak of a round in flight. They draw with `fxFlash`, `fxSmoke` and `fxSpark` in `combat/shaders/`. |
| `blast/` | `wall_blast` | A charge blowing a breach through a stone block wall, on a 9.6 s loop. |
| `storm/` | `storm`, `tower` | A thunderstorm around a lone tower: wind-driven rain, lightning striking on the schedule `schedule.module` keeps, and sparks and smoke where strikes land. `tower` is the stone keep it stands around. |
| `rift/` | `arcane_rift` | A rift tearing open in the ground, its motes and rubble moved by the compute shaders in `rift/compute/`. |
| `dragon/` | `dragon_breath` | A dragon's fire breath sweeping a courtyard: a flame jet, rolling smoke and drifting embers. |
| `launch/` | `launch` | A heavy-lift rocket liftoff on one looping timeline, with the heat-haze material `rk_haze_mat`. |
| `waterfall/` | `wf_env`, `wf_water`, `wf_spray`, `wf_foam`, `wf_mist` | A waterfall built in parts: the cliff, basin and boulders, the falling and still water, the droplets, the foam where the falls land, and the mist with its rainbow. Its water materials are in `waterfall/materials/`. |
| `shaders/` | | `fx_noise`, the noise functions the waterfall and wall blast shaders include. |
## Playing one
A graph plays on a `Generator` component bound to it:
```lua
-- `graph` is the graph's reference: the AssetRef `asset.resolve` or a search returns for it.
local e = entity.spawn("impact", { position = { 0, 1, 0 } })
e.component.add("Generator", { graph = graph, playOn = "load" })
```
Set a graph's inputs with the Generator's `params`, e.g. `params = { size = 3 }`.