From 5e4db82ac888126cedfc8e28c9162d149e7e2331 Mon Sep 17 00:00:00 2001 From: Jonas Wagner Date: Wed, 20 Jul 2022 21:10:26 +0000 Subject: [PATCH] Improved docs --- README.md | 3 ++- simplex-noise.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3dadc6..f30c01a 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,8 @@ const simplex = { - Removed the built in version of the alea PRNG to focus the library to do only one thing. If you want to continue to use it you'll have to install and import it separately. - Noise functions are a bit faster (~ 10-20%) due to using integers in some places -- Noise values can be different from previous versions especially for inputs > 2^31 +- Noise values can be different from previous versions +- Inputs coordinates bigger than 2^31 may not result in a noisy output anymore. - Test coverage is now at 100% ### 3.0.1 diff --git a/simplex-noise.ts b/simplex-noise.ts index ca241b9..d259f56 100644 --- a/simplex-noise.ts +++ b/simplex-noise.ts @@ -90,6 +90,8 @@ export type RandomFn = () => number; /** * Samples the noise field in two dimensions + * + * Coordinates should be finite, bigger than -2^31 and smaller than 2^31. * @param x * @param y * @returns a number in the interval [-1, 1] @@ -177,6 +179,8 @@ export function createNoise2D(random: RandomFn = Math.random): NoiseFunction2D { /** * Samples the noise field in three dimensions + * + * Coordinates should be finite, bigger than -2^31 and smaller than 2^31. * @param x * @param y * @param z @@ -315,6 +319,8 @@ export function createNoise3D(random: RandomFn = Math.random): NoiseFunction3D { /** * Samples the noise field in four dimensions + * + * Coordinates should be finite, bigger than -2^31 and smaller than 2^31. * @param x * @param y * @param z