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); }
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); }