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

NameTypeNotes
basisReliefBasis

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 reliefStylizeProps from the utilities, which also sets their sliders.

See also

  • reliefBases — The height fields noiseRelief accepts: stone (marbled stone) and wool (interwoven fibres).

Used by

Stone, Wool