# wf_rock
World-space procedural wet rock: strata, moss, mineral streaks, bump and spray-driven wetness for
the meshed signed-distance cliff of the waterfall. Every pattern is computed from the world position
relative to the waterfall's origin (`origin_x`, `origin_y`, `origin_z`). It is a `surface()` shader
that fills a `PbrSurface`.
A height field of `fx_noise` fBm plus ridged fBm gives the bump normal, scaled by `bump`. The dry
rock is warm and pale, banded into long warped horizontal beds with grain. Dark seeps run down the
face on either side of the falls, fading out between 6 and 17 units from its centre line. Wetness
comes from the falls' spray around the plunge line, the waterline around the pool, and the seeps;
wet rock is darker (by up to 42 percent) and glossier (roughness from 0.92 down to 0.28). Moss grows
on gentle upward faces that stay wet, scaled by `moss`, and rust-brown mineral streaks run down the
face. The albedo is multiplied by `gain` and `tint`, and occlusion follows the height field.
The `wf_env` graph (`waterfall/wf_env.procGraph`) applies it to the cliff, plunge basin and boulders it
contours from signed-distance solids, with the origin at z 42, `bump` 0.55 and `moss` 1.0. The
Procgen Effects Showcase world's `wf_ground_mat` material uses it with the same origin, `bump` 0.4, `gain` 1.15, `moss` 1.3 and a
warm `tint` (1.25, 1.08, 0.85), and the Procgen Effects Showcase world's `fx_falls` scene places that material.
The shader includes `fx_noise` and `@builtin::shaderModules.pbr_shading`.
## Properties
| Property | Type | Default | Meaning |
|---|---|---|---|
| `bump` | float | 0.55 | Strength of the bump normal (range 0 to 3). |
| `moss` | float | 1.0 | Amount of moss on wet upward faces (range 0 to 2). |
| `tint` | color | [1, 1, 1, 1] | Multiplies the albedo. |
| `gain` | float | 0.75 | Multiplies the albedo (range 0 to 2). |
| `origin_x` | float | 0 | World X of the waterfall origin. |
| `origin_y` | float | 0 | World Y of the waterfall origin. |
| `origin_z` | float | 0 | World Z of the waterfall origin. |
# 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 }`.