Provides a noise module that outputs a three-dimensional billowy noise. [GENERATOR]
Inheritance: ModuleBase
Esempio n. 1
0
 public void Bill()
 {
     LibNoise.Generator.Billow _noise = new LibNoise.Generator.Billow();
     _noise.Seed        = Seed;
     _noise.OctaveCount = OctaveCount;
     _noise.Persistence = Persistence;
     _noise.Frequency   = Frequency;
     _noise.Lacunarity  = Lacunarity;
     Heights(terr, _noise);
 }
    void GenerateNoise()
    {
        float modifier;

        float newFrequency     = Random.Range(frequency.x, frequency.y);
        float newAmplification = Random.Range(amplification.x, amplification.y);

        var noise = new LibNoise.Generator.Billow(newFrequency, lacu, persist, octaves, Random.Range(0, 0xffffff), QualityMode.High);

        for (int i = 0; i < vertices.Length; i++)
        {
            modifier    = (float)noise.GetValue(vertices[i].x, vertices[i].y, vertices[i].z);
            modifier    = ((modifier - 0.5f) / newAmplification) + 0.99f;
            vertices[i] = Vector3.Scale(vertices[i], (Vector3.one * modifier));
        }
    }