Perlin noise generator algorithm