wave

Ripple the child with a travelling wave.

wave(slots: {strength: ArgSpec; frequency: ArgSpec; angle: ArgSpec; waveType: PropRef}): UvMapSource

Import warps from shaders/std and use warps.wave.

angle is the travel direction in degrees, frequency the number of waves across the canvas, strength (0–1) how far pixels move. waveType is a prop marked compileTime: true holding 'sine', 'triangle', 'square', 'sawtooth' or 'bounce'. The wave moves with the layer's clock, so declare animatedTime: {speed: 'speed'}.

Parameters

NameTypeNotes
slots{strength: ArgSpec; frequency: ArgSpec; angle: ArgSpec; waveType: PropRef}

Example

map: warps.wave({strength: p('strength'), frequency: p('frequency'), angle: p('angle'), waveType: p('waveType')})

Tip. Changing waveType recompiles the shader; the other inputs update live.

See also

  • flowNoise — Push the child around with a slowly flowing liquid motion.
  • barOffset — Cut the child into parallel bars and shift each one sideways by a random amount.

Used by

WaveDistortion