cb_common.shaderModule
- .metadata43 B
- README.md1.0 KB
- module.wgsl4.7 KB
README.md
cb_common
Cloudburst's shared WGSL, included by every Cloudburst shader and by any water or ground shader that wants to answer the rain.
cb_hash11/12/22/33,cb_noise2,cb_fbm2: the randomness every layer draws from.cb_wrap,cb_wrap_count: keep a moving drop inside the box that follows the camera.cb_land_height(land, xz): where falling weather meets the top of the world (roofs, canopies, ground). Lives incb_land, which needs alandmaptexture slot and thelandplacement vec4.cb_ripples(xz, time, rate): rings spreading where drops hit flat water: slope in.xy, ring strength in.z. A pond, puddle or a water kit's own surface includes this module and feeds it the rain rate (require("cloudburst.weather").bind(material)keeps a material'scb_rainproperty current).
#include "cloudburst.shaderModules.cb_common"
let r = cb_ripples(input.world_position.xz, input.time, material.cb_rain.x);
n = normalize(n + vec3<f32>(r.x, 0.0, r.y));