예제 #1
0
        public override float GenerateNoise(OverworldGeneratorV2 generator, int passedX, int passedY, float border, float river)
        {
            var jitterData = SimplexData2D.NewDisk();

            generator.SimplexInstance(1).GetValue(passedX / _jitterWavelength, passedY / _jitterWavelength, jitterData);
            float x         = (float)(passedX + jitterData.GetDeltaX() * _jitterAmplitude);
            float y         = (float)(passedY + jitterData.GetDeltaY() * _jitterAmplitude);
            float bordercap = (bordercap = border * 3.5f - 2.5f) > 1 ? 1.0f : bordercap;
            float rivercap  = (rivercap = 3f * river) > 1 ? 1.0f : rivercap;
            float bumpiness = generator.SimplexInstance(2).GetValue(x / _bumpinessWavelength, y / _bumpinessWavelength) * _bumpinessMultiplier;
            float simplex   = _plateau.Added(generator, x, y) * bordercap * rivercap + bumpiness;
            float added     = PlateauUtil.StepIncrease(simplex, _stepStart, _stepFinish, _stepHeight) / border;

            return(Riverized(BaseHeight + TerrainBase.GetGroundNoise(x, y, _groundNoise, generator), river) + added);
        }
예제 #2
0
        public static float TerrainGrasslandHills(int x, int y, OverworldGeneratorV2 generator, float river,
                                                  float vWidth, float vHeight, float hWidth, float hHeight, float bHeight)
        {
            float h = generator.SimplexInstance(0).GetValue(x / vWidth, y / vWidth);

            h = BlendedHillHeight(h, 0.3f);

            float m = generator.SimplexInstance(1).GetValue(x / hWidth, y / hWidth);

            m  = BlendedHillHeight(m, 0.3f) * h;
            m *= m;

            h *= vHeight * river;
            m *= hHeight * river;

            h += TerrainBase.GetGroundNoise(x, y, 4f, generator);

            return(Riverized(generator, bHeight + h, river) + m);
        }