Perlin Noise API Code

Hey guys… I have been looking for some type of JS API for generating perlin nose

Unity has float Mathf.PerlinNoise(float x, float y)

Do we have anyway using code to generate perlin noise ???

1 Like

There’s one in the shaders folder Babylon.js/noise.fragment.fx at master · BabylonJS/Babylon.js · GitHub

and one in the procedural textures library Babylon.js/proceduralTexturesLibrary/src/perlinNoise at master · BabylonJS/Babylon.js · GitHub

1 Like

@MackeyK24, I saw @nasimiasl and @Pryme8 using PERLIN in shaders.

One was in the sandDune PG, and the other in this volumetric fog link…

1 Like

Should be in a working state… its beeeeen a long time.

just glancing over it, I was reworking this and only perlin2 and worly2 are accessible, but the code for more is there.

2 Likes

Wowza! No way… really? Nice!
:trophy:

Looking…

That MATH makes my day… like VITAMINS.

Check out:

dN.lerp = function(a, b, t) {
    return (1-t)*a + t*b;
  }

:star2: Then in Perlin3


    return lerp(
        lerp(
         lerp(n000, n100, u),
          lerp(n001, n101, u), w),
        lerp(
         lerp(n010, n110, u),
          lerp(n011, n111, u), w),
       v);
  };

LuvIt!

Looks like lots of Matrix Math, is as far as I can decipher. Maybe I way off.

:eagle: : )

1 Like