Ejemplo n.º 1
0
        public INoise GetLandFormFct()
        {
            //REM
            //The various parameters value here are scaled for a gradient being feed by 0 to 1 input value.
            //When this gradient is configured to recevied other value range then some parameters needs to be rescaled
            //That's the reason for using this _groundGradientTyped.AdjustY value
            //This way no matter the the Gradient Range, the values impacting it will be rescaled.

            //Create the Lowland base fractal with range from 0 to 1 values
            INoise montain_shape_fractal = new FractalFbm(new Simplex(_seed), 4, 3.5, enuBaseNoiseRange.ZeroToOne);
            INoise montain_shape_Ajusted = new ScaleOffset(montain_shape_fractal, 0.9, -0.02);

            //Rescale + offset the output result ==> Wil modify the Scope of output range value
            //Enforce gradient to have a solid underground
            INoise _groundGradientAjusted = new Bias(_groundGradient, 0.55);
            INoise adjustedGradient       = new ScaleOffset(_groundGradientAjusted, 1.4, 0);

            Combiner noiseCombiner = new Combiner(Combiner.CombinerType.Add);

            noiseCombiner.Noises.Add(montain_shape_Ajusted);
            noiseCombiner.Noises.Add(adjustedGradient);

            INoise rescaledCombinedNoise = new ScaleOffset(noiseCombiner, 0.45, 0);

            return(rescaledCombinedNoise);
        }
Ejemplo n.º 2
0
        public INoise GetLandFormFct()
        {
            INoise AnomaliesZonesFractal           = new FractalFbm(new Perlin(_seed), _octaves, _frequency, enuBaseNoiseRange.ZeroToOne);
            INoise AnomaliesZonesFractal_as2DNoise = new NoiseAccess(AnomaliesZonesFractal, NoiseAccess.enuDimUsage.Noise2D, true);
            INoise AnomaliesZonesFractal_Bias      = new Gain(AnomaliesZonesFractal_as2DNoise, _bias);

            return(AnomaliesZonesFractal_Bias);
        }
Ejemplo n.º 3
0
        public INoise GetLandFormFct()
        {
            //Create a Landscape 2D (Forced no matter the sampling realized on it).
            INoise islandDisk = new Sphere(_radius, 0, 0);

            //Perturbation on the X and Y space
            INoise islandDiskXPerturb = new FractalFbm(new Perlin(_seed + 3), 10, 3);
            INoise islandDiskYPerturb = new FractalFbm(new Perlin(_seed + 5), 10, 3);

            INoise islandTurbulence = new NoiseAccess(new Turbulence(islandDisk, islandDiskXPerturb, 0.0, islandDiskYPerturb), NoiseAccess.enuDimUsage.Noise2D, true);

            return(islandTurbulence);
        }
Ejemplo n.º 4
0
        public INoise GetLandFormFct()
        {
            //Create the Lowland base fractal with range from 0 to 1 values
            INoise Moisture_fractal        = new FractalFbm(new Simplex(_seed), _octave, _freq, enuBaseNoiseRange.ZeroToOne);
            INoise ClampedValue            = new Clamp(Moisture_fractal, 0, 1);
            INoise Moisture_fractal_biased = new Gain(ClampedValue, 0.6);
            INoise Moisture_fractal_Offset = new ScaleOffset(Moisture_fractal_biased, 1, 0.1);
            INoise ClampedValue2           = new Clamp(Moisture_fractal_Offset, 0, 1);

            return(ClampedValue2);

            //INoise TempOffset = new ScaleOffset(new Voronoi2(_seed, _freq, 0.6, new ScaleOffset(new FractalFbm(new Perlin(12345), 3, 2), 0.4, 0.0)), 1.0, 1.0); // + 1
            //INoise TempScale = new ScaleOffset(TempOffset, 0.5, 0.0); // / 2
            //INoise ClampedValue = new Clamp(TempScale, 0, 1);
            //return ClampedValue;
        }
Ejemplo n.º 5
0
        public INoise GetLandFormFct()
        {
            //REM
            //The various parameters value here are scaled for a gradient being feed by 0 to 1 input value.
            //When this gradient is configured to recevied other value range then some parameters needs to be rescaled
            //That's the reason for using this _groundGradientTyped.AdjustY value
            //This way no matter the the Gradient Range, the values impacting it will be rescaled.

            INoise shape1_fractal = new FractalRidgedMulti(new Perlin(_seed), 1, 1.2);

            INoise shape1_base = new Select(0, shape1_fractal, shape1_fractal, 0.75, 0.0);

            INoise shape2_fractal = new FractalRidgedMulti(new Perlin(_seed + 12345), 1, 1.3);

            INoise shape2_base = new Select(0, shape2_fractal, shape2_fractal, 0.75, 0.0);

            Combiner ShapeMult = new Combiner(Combiner.CombinerType.Add);

            ShapeMult.Noises.Add(shape1_base);
            ShapeMult.Noises.Add(shape2_base);

            INoise CacheShapeMult = new Cache <INoise>(ShapeMult);

            INoise rescaledShapeMult = new ScaleOffset(CacheShapeMult, 0.6, 0);
            INoise clamping_base     = new Select(0, rescaledShapeMult, CacheShapeMult, 0.14, 0.0);

            INoise turbX_fractal = new FractalFbm(new Perlin(_seed + 1), 3, 3);
            INoise turbY_fractal = new FractalFbm(new Perlin(_seed + 2), 3, 3);
            INoise turbZ_fractal = new FractalFbm(new Perlin(_seed + 3), 3, 3);

            INoise CaveTurb = new Turbulence(clamping_base, turbX_fractal, turbY_fractal, turbZ_fractal);

            //INoise landscape = new Bias(_mainLandscape, 0.45);
            Combiner underground_Attenuated = new Combiner(Combiner.CombinerType.Multiply);

            underground_Attenuated.Noises.Add(CaveTurb);
            underground_Attenuated.Noises.Add(_mainLandscape);

            //Merge the Water landForm with the surface landForm
            INoise world_select = new Select(0.0, underground_Attenuated, _islandCtrl, 0.01, 0.0);         //Merge Plains with Midland

            return(world_select);
        }
Ejemplo n.º 6
0
        public INoise GetLandFormFct()
        {
            //REM
            //The various parameters value here are scaled for a gradient being feed by 0 to 1 input value.
            //When this gradient is configured to recevied other value range then some parameters needs to be rescaled
            //That's the reason for using this _groundGradientTyped.AdjustY value
            //This way no matter the the Gradient Range, the values impacting it will be rescaled.

            //Create the Lowland base fractal with range from 0 to 1 values
            INoise ocean_shape_fractal = new FractalFbm(new Simplex(_seed), 3, 3, enuBaseNoiseRange.ZeroToOne);
            //Rescale + offset the output result ==> Wil modify the Scope of output range value
            INoise ocean_scale = new ScaleOffset(ocean_shape_fractal, 0.20 * _groundGradientTyped.AdjustY, 0.08 * _groundGradientTyped.AdjustY);

            //Force the Fractal to be used as 2D Noise, I don't need to 3th dimension
            INoise ocean_y_scale = new NoiseAccess(ocean_scale, NoiseAccess.enuDimUsage.Noise2D, true);


            //Offset the ground_gradient ( = create turbulance) to the Y scale of the gradient. input value
            INoise ocean_terrain = new Turbulence(_groundGradient, 0, ocean_y_scale);

            return(ocean_terrain);
        }