コード例 #1
0
ファイル: SurfaceCtrl.cs プロジェクト: ErtyHackward/utopia
        public INoise GetLandFormFct()
        {
            INoise SurfaceBiomeFractal           = new FractalHybridMulti(new Perlin(_seed), _octaves, _frequency, enuBaseNoiseRange.ZeroToOne);
            INoise SurfaceBiomeFractal_as2DNoise = new NoiseAccess(SurfaceBiomeFractal, NoiseAccess.enuDimUsage.Noise2D, true);

            return(SurfaceBiomeFractal_as2DNoise);
        }
コード例 #2
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 river_shape_fractal = new FractalRidgedMulti(new Simplex(_seed), 1, 2, enuBaseNoiseRange.ZeroToOne);
            //Rescale + offset the output result ==> Wil modify the Scope of output range value
            INoise river_shape_scale = new ScaleOffset(river_shape_fractal, 0.30, 0.01);
            //Remove Y value from impacting the result (Fixed to 0), the value output range will not be changed, but the influence of the Y will be removed

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

            INoise turb           = new ScaleOffset(river_y_scale, 0.03, 0);
            INoise river_selected = new Select(0, turb, river_y_scale, 0.7);  //Last param define the width of the river

            //Offset the ground_gradient ( = create turbulance) to the Y scale of the gradient. input value
            INoise _groundGradient_biased = new Bias(_groundGradient, 0.45);
            INoise river = new Turbulence(_groundGradient_biased, 0, river_selected);

            return(river);
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: IslandCtrl.cs プロジェクト: ErtyHackward/utopia
        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);
        }
コード例 #5
0
ファイル: Ocean.cs プロジェクト: ErtyHackward/utopia
        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);
        }