예제 #1
0
    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));
    }
예제 #2
0
	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);
	}