double AccumulateNoise(DoubleVector3 location, int numberOfOctaves, double lacunarity, double gain)
        {
            double noiseSum     = 0;
            double amplitude    = 1;
            double amplitudeSum = 0;

            DoubleVector3 sampleLocation = location;

            for (int x = 0; x < numberOfOctaves; x++)
            {
                noiseSum     += amplitude * Math.Abs(_simplex.GetNoise(sampleLocation));
                amplitudeSum += amplitude;

                amplitude      *= gain;
                sampleLocation *= lacunarity;
            }

            noiseSum /= amplitudeSum;

            return(noiseSum);
        }
Beispiel #2
0
 public double GetNoise(DoubleVector3 location)
 {
     return(1 - Math.Abs(_sourceGenerator.GetNoise(location)));
 }