noiseRelief
Embosses the layer inside with a textured surface: the child is slightly distorted, then lit by a height field so it reads as carved stone or woven cloth.
noiseRelief(basis: ReliefBasis): (params: GpuFragmentParams) => Expr
Import noise from shaders/std and use noise.noiseRelief.
A filter, not a paint. Set it as the definition's fragment with requiresRTT and requiresChild, and give the definition props named intensity, scale, contrast, distortion and seed. basis is an entry of reliefBases.
Parameters
| Name | Type | Notes |
|---|---|---|
basis | ReliefBasis |
Example
export const Stone = defineShader({
name: 'Stone',
requiresRTT: true,
requiresChild: true,
props: {intensity: {default: 0.5}, scale: {default: 1}, contrast: {default: 0}, distortion: {default: 0.15}, seed: {default: 0}},
gpu: {fragment: noiseRelief(reliefBases.stone)},
})
Tip. The library shaders build those five props with
reliefStylizePropsfrom the utilities, which also sets their sliders.
See also
reliefBases— The height fieldsnoiseReliefaccepts:stone(marbled stone) andwool(interwoven fibres).