warpedPoint

A 3D position pushed around by moving noise, for reading several fields at one warped spot.

warpedPoint(opts: {at: Expr; time: Expr | number; amount: Expr | number; levels?: 1 | 2}): Expr

Import paint from shaders/std and use paint.warpedPoint.

at is the 3D point to warp, time drives the motion, amount how far it is pushed. levels 2 (default) is the full warp, 1 is a cheaper single pass for low-power devices. Use warped instead when one field is enough.

Parameters

NameTypeNotes
opts{at: Expr; time: Expr | number; amount: Expr | number; levels?: 1 | 2}

Example

const q = warpedPoint({at: math.vec3(x, y, seed), time: math.mul(t, 0.3), amount: 0.5, levels: isMobileGpuViewport() ? 1 : 2})

See also

  • warped — Makes a field flow like liquid by bending its coordinate with moving noise.
  • warpStep — One step of a chained warp: pushes a 2D position by two noise reads and hands them back.

Used by

MeshGradient