@@ -146,17 +146,17 @@ MapgenV7Params::MapgenV7Params()
146
146
{
147
147
spflags = MGV7_MOUNTAINS | MGV7_RIDGES;
148
148
149
- np_terrain_base = NoiseParams (4 , 70 , v3f (600 , 600 , 600 ), 82341 , 5 , 0.6 , 2.0 );
150
- np_terrain_alt = NoiseParams (4 , 25 , v3f (600 , 600 , 600 ), 5934 , 5 , 0.6 , 2.0 );
151
- np_terrain_persist = NoiseParams (0.6 , 0.12 , v3f (2000 , 2000 , 2000 ), 539 , 3 , 0.5 , 2.0 );
152
- np_height_select = NoiseParams (-12 , 24 , v3f (500 , 500 , 500 ), 4213 , 6 , 0.69 , 2.0 );
153
- np_filler_depth = NoiseParams (0 , 1.2 , v3f (150 , 150 , 150 ), 261 , 4 , 0.7 , 2.0 );
154
- np_mount_height = NoiseParams (184 , 72 , v3f (1000 , 1000 , 1000 ), 72449 , 3 , 0.5 , 2.0 );
155
- np_ridge_uwater = NoiseParams (0 , 1 , v3f (1000 , 1000 , 1000 ), 85039 , 5 , 0.6 , 2.0 );
156
- np_mountain = NoiseParams (-0.6 , 1 , v3f (250 , 350 , 250 ), 5333 , 5 , 0.68 , 2.0 );
157
- np_ridge = NoiseParams (0 , 1 , v3f (100 , 100 , 100 ), 6467 , 4 , 0.75 , 2.0 );
158
- np_cave1 = NoiseParams (0 , 12 , v3f (100 , 100 , 100 ), 52534 , 4 , 0.5 , 2.0 );
159
- np_cave2 = NoiseParams (0 , 12 , v3f (100 , 100 , 100 ), 10325 , 4 , 0.5 , 2.0 );
149
+ np_terrain_base = NoiseParams (4 , 70 , v3f (600 , 600 , 600 ), 82341 , 5 , 0.6 , 2.0 );
150
+ np_terrain_alt = NoiseParams (4 , 25 , v3f (600 , 600 , 600 ), 5934 , 5 , 0.6 , 2.0 );
151
+ np_terrain_persist = NoiseParams (0.6 , 0.1 , v3f (2000 , 2000 , 2000 ), 539 , 3 , 0.6 , 2.0 );
152
+ np_height_select = NoiseParams (-12 , 24 , v3f (500 , 500 , 500 ), 4213 , 6 , 0.7 , 2.0 );
153
+ np_filler_depth = NoiseParams (0 , 1.2 , v3f (150 , 150 , 150 ), 261 , 3 , 0.7 , 2.0 );
154
+ np_mount_height = NoiseParams (256 , 112 , v3f (1000 , 1000 , 1000 ), 72449 , 3 , 0.6 , 2.0 );
155
+ np_ridge_uwater = NoiseParams (0 , 1 , v3f (1000 , 1000 , 1000 ), 85039 , 5 , 0.6 , 2.0 );
156
+ np_mountain = NoiseParams (-0.6 , 1 , v3f (250 , 350 , 250 ), 5333 , 5 , 0.63 , 2.0 );
157
+ np_ridge = NoiseParams (0 , 1 , v3f (100 , 100 , 100 ), 6467 , 4 , 0.75 , 2.0 );
158
+ np_cave1 = NoiseParams (0 , 12 , v3f (100 , 100 , 100 ), 52534 , 4 , 0.5 , 2.0 );
159
+ np_cave2 = NoiseParams (0 , 12 , v3f (100 , 100 , 100 ), 10325 , 4 , 0.5 , 2.0 );
160
160
}
161
161
162
162
@@ -429,16 +429,20 @@ float MapgenV7::baseTerrainLevelFromMap(int index)
429
429
bool MapgenV7::getMountainTerrainAtPoint (s16 x, s16 y, s16 z)
430
430
{
431
431
float mnt_h_n = NoisePerlin2D (&noise_mount_height->np , x, z, seed);
432
+ float density_gradient = -((float )y / mnt_h_n);
432
433
float mnt_n = NoisePerlin3D (&noise_mountain->np , x, y, z, seed);
433
- return mnt_n * mnt_h_n >= (float )y;
434
+
435
+ return mnt_n + density_gradient >= 0.0 ;
434
436
}
435
437
436
438
437
439
bool MapgenV7::getMountainTerrainFromMap (int idx_xyz, int idx_xz, s16 y)
438
440
{
439
441
float mounthn = noise_mount_height->result [idx_xz];
442
+ float density_gradient = -((float )y / mounthn);
440
443
float mountn = noise_mountain->result [idx_xyz];
441
- return mountn * mounthn >= (float )y;
444
+
445
+ return mountn + density_gradient >= 0.0 ;
442
446
}
443
447
444
448
0 commit comments