Skip to content
Permalink
Browse files

Remove 3D noise from getSteps function (#6360)

  • Loading branch information...
vlapsley authored and nerzhul committed Sep 2, 2017
1 parent c0dac4d commit 2ac5a45faa26a9192ab3c3940d939b18b0df8b38
Showing with 10 additions and 10 deletions.
  1. +1 −1 builtin/settingtypes.txt
  2. +1 −1 minetest.conf.example
  3. +7 −7 src/mapgen_carpathian.cpp
  4. +1 −1 src/mapgen_carpathian.h
@@ -1501,7 +1501,7 @@ mgcarpathian_np_ridge_mnt (Ridged mountain size noise) noise_params 0, 12, (743,
mgcarpathian_np_step_mnt (Step mountain size noise) noise_params 0, 8, (509, 509, 509), 2590, 6, 0.6, 2.0

# 3D noise for mountain overhangs, cliffs, etc. Usually small variations.
mgcarpathian_np_mnt_var (Mountain variation noise) noise_params 0, 1, (499, 499, 499), 2490, 5, 0.6, 2.0
mgcarpathian_np_mnt_var (Mountain variation noise) noise_params 0, 1, (499, 499, 499), 2490, 5, 0.55, 2.0

# First of 2 3D noises that together define tunnels.
mgcarpathian_np_cave1 (Cave1 noise) noise_params 0, 12, (61, 61, 61), 52534, 3, 0.5, 2.0
@@ -1842,7 +1842,7 @@

# 3D noise for mountain overhangs, cliffs, etc. Usually small variations.
# type: noise_params
# mgcarpathian_np_mnt_var = 0, 1, (499, 499, 499), 2490, 5, 0.6, 2.0
# mgcarpathian_np_mnt_var = 0, 1, (499, 499, 499), 2490, 5, 0.55, 2.0

# First of 2 3D noises that together define tunnels.
# type: noise_params
@@ -120,7 +120,7 @@ MapgenCarpathianParams::MapgenCarpathianParams()
np_hills = NoiseParams(0, 3, v3f(257, 257, 257), 6604, 6, 0.5, 2.0);
np_ridge_mnt = NoiseParams(0, 12, v3f(743, 743, 743), 5520, 6, 0.7, 2.0);
np_step_mnt = NoiseParams(0, 8, v3f(509, 509, 509), 2590, 6, 0.6, 2.0);
np_mnt_var = NoiseParams(0, 1, v3f(499, 499, 499), 2490, 5, 0.6, 2.0);
np_mnt_var = NoiseParams(0, 1, v3f(499, 499, 499), 2490, 5, 0.55, 2.0);
np_cave1 = NoiseParams(0, 12, v3f(61, 61, 61), 52534, 3, 0.5, 2.0);
np_cave2 = NoiseParams(0, 12, v3f(67, 67, 67), 10325, 3, 0.5, 2.0);
np_cavern = NoiseParams(0, 1, v3f(384, 128, 384), 723, 5, 0.63, 2.0);
@@ -195,11 +195,11 @@ inline float MapgenCarpathian::getLerp(float noise1, float noise2, float mod)
}

// Steps function
float MapgenCarpathian::getSteps(float noise1, float noise2)
float MapgenCarpathian::getSteps(float noise)
{
float w = fabs(noise2);
float k = floor(noise1 / w);
float f = (noise1 - k * w) / w;
float w = 0.5f;
float k = floor(noise / w);
float f = (noise - k * w) / w;
float s = std::fmin(2.f * f, 1.f);
return (k + s) * w;
}
@@ -343,7 +343,7 @@ float MapgenCarpathian::terrainLevelAtPoint(s16 x, s16 z)
float ridged_mountains = pow(rter, 3.f) * ridge_mnt;

// Step (terraced) mountains
float step_mnt = hilliness * getSteps(n_step_mnt, fabs(mnt_var));
float step_mnt = hilliness * getSteps(n_step_mnt);
float step_mountains = pow(ster, 3.f) * step_mnt;

// Final terrain level
@@ -430,7 +430,7 @@ int MapgenCarpathian::generateTerrain()
// Step (terraced) mountains
float ster = noise_step_terrain->result[index2d];
float n_step_mnt = noise_step_mnt->result[index2d];
float step_mnt = hilliness * getSteps(n_step_mnt, fabs(mnt_var));
float step_mnt = hilliness * getSteps(n_step_mnt);
float step_mountains = pow(fabs(ster), 3.f) * step_mnt;

// Final terrain level
@@ -74,7 +74,7 @@ class MapgenCarpathian : public MapgenBasic

virtual MapgenType getType() const { return MAPGEN_CARPATHIAN; }

float getSteps(float noise1, float noise2);
float getSteps(float noise);
inline float getLerp(float noise1, float noise2, float mod);

virtual void makeChunk(BlockMakeData *data);

0 comments on commit 2ac5a45

Please sign in to comment.
You can’t perform that action at this time.