Add subtle island terrain relief

This commit is contained in:
chelsea
2026-05-03 11:58:59 -05:00
parent acd5eaa52f
commit afbf333622
2 changed files with 13 additions and 0 deletions

View File

@@ -693,6 +693,19 @@ static int raw_column_height(worldgen_ctx *ctx, int x, int z) {
height = height * (1.0 - plains_blend) + plains_target * plains_blend;
}
double above_water = height - (double)ctx->sea_level;
if (above_water > -1.5 && above_water < 24.0) {
double island_mask = smoothstep01((above_water + 1.5) / 6.0) * (1.0 - smoothstep01((above_water - 12.0) / 12.0));
island_mask *= 1.0 - build_flats * 0.7;
double rolling = simplex_noise2(&ctx->noise, (warp2_x + 76000) * 0.0045, (warp2_z - 76000) * 0.0045) * 3.2;
rolling += simplex_noise2(&ctx->noise, (warp2_x - 83000) * 0.013, (warp2_z + 83000) * 0.013) * 1.4;
double mound = simplex_noise2(&ctx->noise, (warp2_x + 91000) * 0.021, (warp2_z - 91000) * 0.021) * 0.5 + 0.5;
rolling += mound * mound * 2.0;
double coastal_mask = (1.0 - smoothstep01((above_water - 1.0) / 5.0)) * smoothstep01((above_water + 1.0) / 3.0);
double dune = fabs(simplex_noise2(&ctx->noise, (warp2_x - 47000) * 0.028, (warp2_z + 47000) * 0.028)) * 2.2;
height += (rolling * island_mask) + (dune * coastal_mask * (1.0 - build_flats * 0.85));
}
return (int)height;
}