Search in sources :

Example 1 with PerlinNoise

use of org.terasology.utilities.procedural.PerlinNoise in project Terasology by MovingBlocks.

the class PerlinHillsAndMountainsProvider method setSeed.

@Override
public void setSeed(long seed) {
    // TODO: reduce the number of octaves in BrownianNoise
    mountainNoise = new SubSampledNoise(new BrownianNoise(new PerlinNoise(seed + 3)), new Vector2f(0.0002f, 0.0002f), 4);
    hillNoise = new SubSampledNoise(new BrownianNoise(new PerlinNoise(seed + 4)), new Vector2f(0.0008f, 0.0008f), 4);
}
Also used : Vector2f(org.terasology.math.geom.Vector2f) SubSampledNoise(org.terasology.utilities.procedural.SubSampledNoise) PerlinNoise(org.terasology.utilities.procedural.PerlinNoise) BrownianNoise(org.terasology.utilities.procedural.BrownianNoise)

Example 2 with PerlinNoise

use of org.terasology.utilities.procedural.PerlinNoise in project Terasology by MovingBlocks.

the class PerlinHumidityProvider method reload.

private void reload() {
    float realScale = config.scale * 0.01f;
    Vector2f scale = new Vector2f(realScale, realScale);
    BrownianNoise brown = new BrownianNoise(new PerlinNoise(seed + 6), config.octaves);
    humidityNoise = new SubSampledNoise(brown, scale, SAMPLE_RATE);
}
Also used : Vector2f(org.terasology.math.geom.Vector2f) SubSampledNoise(org.terasology.utilities.procedural.SubSampledNoise) PerlinNoise(org.terasology.utilities.procedural.PerlinNoise) BrownianNoise(org.terasology.utilities.procedural.BrownianNoise)

Example 3 with PerlinNoise

use of org.terasology.utilities.procedural.PerlinNoise in project Terasology by MovingBlocks.

the class PerlinBaseSurfaceProvider method setSeed.

@Override
public void setSeed(long seed) {
    BrownianNoise source = new BrownianNoise(new PerlinNoise(seed), 8);
    surfaceNoise = new SubSampledNoise(source, new Vector2f(0.004f, 0.004f), SAMPLE_RATE);
}
Also used : Vector2f(org.terasology.math.geom.Vector2f) SubSampledNoise(org.terasology.utilities.procedural.SubSampledNoise) PerlinNoise(org.terasology.utilities.procedural.PerlinNoise) BrownianNoise(org.terasology.utilities.procedural.BrownianNoise)

Aggregations

Vector2f (org.terasology.math.geom.Vector2f)3 BrownianNoise (org.terasology.utilities.procedural.BrownianNoise)3 PerlinNoise (org.terasology.utilities.procedural.PerlinNoise)3 SubSampledNoise (org.terasology.utilities.procedural.SubSampledNoise)3