Skip to main content

createNoise2D()

Part of the @remotion/noise package.

Creates 2D noise. The function takes one argument:

A NoiseFunction2D is returned:

tsx
import { createNoise2D } from "@remotion/noise";
import type { NoiseFunction2D } from "@remotion/noise";
 
const noise2d: NoiseFunction2D = createNoise2D("my-seed");
 
const x = 32;
const y = 40;
console.log(noise2d(x, y)); // a number in the interval [-1, 1] which corresponds to (x, y) coord.
tsx
import { createNoise2D } from "@remotion/noise";
import type { NoiseFunction2D } from "@remotion/noise";
 
const noise2d: NoiseFunction2D = createNoise2D("my-seed");
 
const x = 32;
const y = 40;
console.log(noise2d(x, y)); // a number in the interval [-1, 1] which corresponds to (x, y) coord.

Credits

Dependency: simplex-noise

See also