math docs
    Preparing search index...

    Function domainWarp2

    • Domain warping (2D): offsets a point by a noise-derived vector, so feeding the result back into a noise source bends and swirls it - marble, meandering terrain, organic distortion. The two axes sample the warp noise at decorrelated offsets so they don't move in lockstep.

      Parameters

      • out: vec2.Vec2

        the receiving Vec2 (the warped point)

      • sample: (x: number, y: number) => number

        the warp noise source, sampled at (x, y)

      • x: number

        x coordinate

      • y: number

        y coordinate

      • amount: number = 1

        displacement scale (default 1)

      Returns vec2.Vec2

      out