public static NoiseSample Sum(NoiseMethodPrime method, Vector3 point, float frequency, int octaves, float lacunarity, float persistence) { NoiseSample sum = method(point, frequency); float amplitude = 1f; float range = 1f; for (int o = 1; o < octaves; o++) { frequency *= lacunarity; amplitude *= persistence; range += amplitude; sum += method(point, frequency) * amplitude; } return(sum * (1f / range)); }
public static NoiseSample Sum (NoiseMethodPrime method, Vector3 point, float frequency, int octaves, float lacunarity, float persistence) { NoiseSample sum = method (point, frequency); float amplitude = 1f; float range = 1f; for (int o = 1; o < octaves; o++) { frequency *= lacunarity; amplitude *= persistence; range += amplitude; sum += method(point, frequency) * amplitude; } return sum * (1f / range); }