Example #1
0
        public static float Noise(float x, float y, float z, uint octaves, float atten = .5f)
        {
            float  wsum = 0;
            float  w    = 1;
            float  freq = 1;
            double v    = 0;

            for (uint i = 0; i < octaves; i++)
            {
                v += w * SimplexNoise.Noise(x * freq, y * freq, z * freq);

                wsum += w;
                w    *= atten;
                freq *= 2;
            }
            return((float)(v / wsum));
        }
Example #2
0
 float DefaultHeightFunc(float x, float y, float z)
 {
     return((float)SimplexNoise.Noise(x, y, z));
 }