Ejemplo n.º 1
0
        public int spikeOctave = 2; //

        override public float added(RTGWorld rtgWorld, float x, float y)
        {
            float noise = rtgWorld.simplex.octave(hillOctave).noise2(x / hillWavelength, y / hillWavelength);

            noise = TerrainBase.blendedHillHeight(noise);
            float spikeNoise = rtgWorld.simplex.octave(spikeOctave).noise2(x / spikeWavelength, y / spikeWavelength);

            spikeNoise = TerrainBase.blendedHillHeight(spikeNoise * noise);
            return(noise * hillHeight + spikeNoise * spikeHeight);
        }
Ejemplo n.º 2
0
        override public float added(RTGWorld rtgWorld, float x, float y)
        {
            float noise = rtgWorld.simplex.octave(octave).noise2(x / wavelength, y / wavelength);

            noise = TerrainBase.blendedHillHeight(noise, hillBottomSimplexValue);
            if (subordinate == null)
            {
                return(noise * height);
            }
            return(noise * (height + subordinate.added(rtgWorld, x, y)));
        }
Ejemplo n.º 3
0
        public float power = 1.6f;                  // usually a range of 1 to 2

        override public float added(RTGWorld rtgWorld, float x, float y)
        {
            float noise = rtgWorld.simplex.octave(octave).noise2((float)x / wavelength, (float)y / wavelength);

            if (noise < minimumSimplex)
            {
                noise = minimumSimplex;
            }
            noise = 1f - (1f - noise) / (1f - minimumSimplex);
            noise = TerrainBase.unsignedPower(noise, power);
            return(noise * height);
        }
Ejemplo n.º 4
0
        override public float added(RTGWorld rtgWorld, float x, float y)
        {
            float noise = rtgWorld.simplex.octave(hillOctave).noise2(x / mountainWavelength, y / mountainWavelength);

            noise = Math.Abs(noise);
            noise = TerrainBase.blendedHillHeight(noise, 0f);
            //transform to be more mountainous
            noise = TerrainBase.unsignedPower(noise, 1.7f);
            noise = 1f - (1f - noise) / (1f - adjustedBottom);
            float spikeNoise = rtgWorld.simplex.octave(spikeOctave).noise2((float)x / spikeWavelength, (float)y / spikeWavelength);

            spikeNoise  = Math.Abs(noise);
            spikeNoise  = TerrainBase.blendedHillHeight(noise, 0f);
            spikeNoise *= noise;
            return(noise * mountainHeight + spikeNoise * spikeHeight);
        }
Ejemplo n.º 5
0
        public static float terrainGrasslandHills(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float river, float vWidth, float vHeight, float hWidth, float hHeight, float bHeight)
        {
            float h = simplex.noise2(x / vWidth, y / vWidth);

            h = blendedHillHeight(h, 0.3f);

            float m = simplex.octave(1).noise2(x / hWidth, y / hWidth);

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

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

            h += TerrainBase.groundNoise(x, y, 4f, simplex);

            return(riverized(bHeight, river) + h + m);
        }
Ejemplo n.º 6
0
        override public float added(RTGWorld rtgWorld, float x, float y)
        {
            float noise = rtgWorld.simplex.octave(hillOctave).noise2(x / mountainWavelength, y / mountainWavelength);

            noise = Math.Abs(noise);
            noise = TerrainBase.blendedHillHeight(noise, 0.2f);
            noise = 1f - (1f - noise) / (1f - adjustedBottom);
            float spikeNoise = rtgWorld.simplex.octave(spikeOctave).noise2(x / spikeWavelength, y / spikeWavelength);

            spikeNoise  = Math.Abs(noise);
            spikeNoise  = TerrainBase.blendedHillHeight(noise, 0.1f);
            spikeNoise *= spikeNoise;
            spikeNoise  = TerrainBase.blendedHillHeight(spikeNoise * noise);
            if (noise > 1.01)
            {
                throw new Exception();
            }
            if (spikeNoise > 1.01)
            {
                throw new Exception();
            }
            return(noise * mountainHeight + spikeNoise * spikeHeight);
        }
Ejemplo n.º 7
0
 override public float added(RTGWorld rtgWorld, float x, float y)
 {
     return(TerrainBase.groundNoise(x, y, amplitude, rtgWorld.simplex));
 }