mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-17 16:17:02 +08:00
refactor: adjust mountain spawn probability
This commit is contained in:
@@ -185,7 +185,7 @@ int get_interpolated_height(float world_x, float world_z, float temp,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
BiomeType determine_biome(const BiomeConditions& conditions) {
|
BiomeType determine_biome(const BiomeConditions& conditions) {
|
||||||
if (conditions.mountainous > 0.85) {
|
if (conditions.mountainous > 0.75) {
|
||||||
return MOUNTAIN;
|
return MOUNTAIN;
|
||||||
}
|
}
|
||||||
auto temp = conditions.temp;
|
auto temp = conditions.temp;
|
||||||
|
|||||||
@@ -164,16 +164,16 @@ void ChunkGenerator::generate_heightmap() {
|
|||||||
amplitude = std::lerp(10, 40, t);
|
amplitude = std::lerp(10, 40, t);
|
||||||
*/
|
*/
|
||||||
float t;
|
float t;
|
||||||
if (mountainous >= 0.8f) {
|
if (mountainous >= 0.7f) {
|
||||||
t = Math::smootherstep(0.80f, 0.85, mountainous);
|
t = Math::smootherstep(0.7f, 0.75, mountainous);
|
||||||
base_y = std::lerp(72, 88, t);
|
base_y = std::lerp(72, 88, t);
|
||||||
amplitude = std::lerp(28, 48, t);
|
amplitude = std::lerp(28, 48, t);
|
||||||
} else if (mountainous >= 0.75f) {
|
} else if (mountainous >= 0.65f) {
|
||||||
t = Math::smootherstep(0.75f, 0.80f, mountainous);
|
t = Math::smootherstep(0.65f, 0.7f, mountainous);
|
||||||
base_y = std::lerp(68, 72, t);
|
base_y = std::lerp(68, 72, t);
|
||||||
amplitude = std::lerp(18, 28, t);
|
amplitude = std::lerp(18, 28, t);
|
||||||
} else {
|
} else {
|
||||||
t = Math::smootherstep(0.5, 0.75, mountainous);
|
t = Math::smootherstep(0.55, 0.65, mountainous);
|
||||||
base_y = std::lerp(60, 68, t);
|
base_y = std::lerp(60, 68, t);
|
||||||
amplitude = std::lerp(8, 18, t);
|
amplitude = std::lerp(8, 18, t);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user