liquidDisplace

Move the child smoothly by a displacement field your own simulation produces.

liquidDisplace(slots: {intensity: ArgSpec; output: string}): UvMapSource

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

The liquid or cloth look. output names the simulation output. intensity scales the movement (the library uses 0–20), capped at about 15% of the canvas. Add uvRemapIdentityWhen: ({computeOutputs}) => !computeOutputs?.<output> to the definition so the warp does nothing until the field exists.

Parameters

NameTypeNotes
slots{intensity: ArgSpec; output: string}

Example

map: warps.liquidDisplace({intensity: p('intensity'), output: 'displacement'}),
uvRemapIdentityWhen: ({computeOutputs}) => !computeOutputs?.displacement,

See also

  • gridCellDisplace — Move the child by a displacement field your own simulation produces, one grid cell at a time.
  • flowNoise — Push the child around with a slowly flowing liquid motion.

Used by

Liquify