perlinSlope
The slope of smooth noise at a point, for wavy or molten relief.
perlinSlope(q: Expr, gain: Expr | number): Expr
Import materials from shaders/std and use materials.perlinSlope.
Returns a 2D slope scaled by gain and clamped to ±4, so relief never spikes into seams. Feed its x and y to nudgeNormal.
Parameters
| Name | Type | Notes |
|---|---|---|
q | Expr | |
gain | Expr | number |
Example
const hg = perlinSlope(pat, 0.62)
const n = nudgeNormal(nGeo, mul(hg.member('x'), -0.5), mul(hg.member('y'), -0.5))
See also
nudgeNormal— Tilts a normal by a slope in x and y, turning a height field into relief.fdSlope— The value and slope of any field at a point:value,dxanddy.flowWarp— A slowly folding 2D offset to add to pattern coordinates, for molten or wind-blown motion.