private void InitBiomeProviders(int seed)
        {
            var biomeScale = 128f;// Preset.CoordinateScale;

            //  var biomeScale = 8f * Preset.BiomeSize;

            INoiseModule distortionX = new SimplexPerlin(seed, NoiseQuality.Fast);

            distortionX = new PipeNoiseModule()
            {
                Primitive = distortionX,
                Frequency = 1f / 48.24345f
            };

            INoiseModule distortionY = new SimplexPerlin(seed, NoiseQuality.Fast);

            distortionY = new PipeNoiseModule()
            {
                Primitive = distortionY,
                Frequency = 1f / 32.24145f
            };

            // INoiseModule temperatureNoise = new SimplexPerlin(seed^3, NoiseQuality.Fast);

            /*temperatureNoise = new BillowNoiseModule()
             * {
             *  Primitive = temperatureNoise,
             *  Lacunarity = 2f,
             *  Frequency = 0.25f,
             *  OctaveCount = 1
             * // Scale = 0.1f,
             * // Bias = 1f
             * //  SpectralExponent = 0.8f,
             * // Offset = 1f,
             * // Gain = 2f
             * };*/

            INoiseModule temperatureNoise = new SimplexPerlin(seed ^ 3, NoiseQuality.Fast);

            /* temperatureNoise = new OctaveNoise(temperatureNoise, 4)
             * {
             *   Amplitude = 16f,
             *   Frequency = 1.8f
             * };
             */
            temperatureNoise = new VoronoiNoseModule()
            {
                Primitive    = temperatureNoise,
                Distance     = false,
                Frequency    = 0.343f,//0.125644f,
                Displacement = 1f,
                Size         = 2,
            };

            temperatureNoise = new ScaledNoiseModule(temperatureNoise)
            {
                ScaleX = 1f / biomeScale, ScaleY = 1f / biomeScale, ScaleZ = 1f / biomeScale
            };

            temperatureNoise = new TurbulenceNoiseModule(temperatureNoise, distortionX, distortionY, distortionY, 16f);

            //  temperatureNoise = new AverageSelectorModule(temperatureNoise, temperatureNoise);


            INoiseModule rainNoise = new SimplexPerlin(seed * seed ^ 2, NoiseQuality.Fast);

            rainNoise = new VoronoiNoseModule()
            {
                Primitive    = rainNoise,
                Distance     = false,
                Frequency    = 0.22776f,
                Displacement = 1f,
                Size         = 2
            };

            rainNoise = new ScaledNoiseModule(rainNoise)
            {
                ScaleX = 1f / biomeScale, ScaleY = 1f / biomeScale, ScaleZ = 1f / biomeScale
            };

            rainNoise = new TurbulenceNoiseModule(rainNoise, distortionY, distortionX, distortionX, 16f);

            BiomeProvider    = new BiomeProvider();
            RainfallNoise    = rainNoise;
            TemperatureNoise = temperatureNoise;
        }
Exemple #2
0
        private void InitBiomeProviders(int seed)
        {
            // var biomeScale = 32f * Preset.BiomeSize;

            var biomeScale = 8f * Preset.BiomeSize;

            SimplexPerlin temperaturePerlin = new SimplexPerlin(seed + seed * seed, NoiseQuality.Fast);
            INoiseModule  temperatureNoise  = new OctaveNoise(temperaturePerlin, 4)
            {
                Amplitude = 3f,
                Frequency = 0.535f
            };

            temperatureNoise = new ScaledNoiseModule(temperatureNoise)
            {
                ScaleX = 1f / biomeScale,
                ScaleZ = 1f / biomeScale,
                ScaleY = 1f / biomeScale
            };

            temperatureNoise = new VoronoiNoseModule()
            {
                Primitive = temperatureNoise,
                Distance  = false,
                Frequency = 0.2325f,
                //    SpectralExponent = 0.25f
            };

            INoiseModule rainNoise = new SimplexPerlin(seed - seed * seed, NoiseQuality.Fast);

            rainNoise = new OctaveNoise(rainNoise, 4)
            {
                Amplitude = 3f,
                Frequency = 0.345f
            };

            rainNoise = new ScaledNoiseModule(rainNoise)
            {
                ScaleX = 1f / biomeScale,
                ScaleZ = 1f / biomeScale,
                ScaleY = 1f / biomeScale
            };

            rainNoise = new VoronoiNoseModule()
            {
                Primitive = rainNoise,
                Distance  = false,
                Frequency = 0.25f,
                // SpectralExponent = 0.25f
            };

            BiomeProvider = new BiomeProvider()
            {
                //RainfallProvider = rainNoise,
                //TemperatureProvider = temperatureNoise
            };
            RainfallNoise    = rainNoise;
            TemperatureNoise = temperatureNoise;

            /* TemperatureNoise = new SpacedCellularNoise(seed * seed)
             * {
             *   Settings = new VoronoiSettings(3200.0)
             * };
             * RainfallNoise = new SpacedCellularNoise(-seed)
             * {
             *   Settings = new VoronoiSettings(3200.0)
             * };*/
        }