Cliff improvements

This commit is contained in:
Joshua Barretto 2021-02-14 02:45:39 +00:00
parent 620e2000d2
commit 9b5c9d1246

View File

@ -94,9 +94,11 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
});
let cliff_height = sim.get_interpolated(wpos, |chunk| chunk.cliff_height)?;
let cliff_scale = 1.0;
let cliff_factor = (alt + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) as f32 * 16.0).rem_euclid(128.0) / 64.0 - 1.0;
let cliff_factor = (alt
+ self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 10.0
+ self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0).rem_euclid(128.0) / 64.0 - 1.0;
let cliff_offset = cliff_factor.abs().powf(if cliff_factor < 0.0 { 1.0 } else { 64.0 }) * cliff_height;
let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.125 + 0.75).max(0.0) as f32;
let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1 + 0.5).max(0.0) as f32;
let alt = alt + cliff_offset * cliff_scale;
let lake_width = (TerrainChunkSize::RECT_SIZE.x as f64 * (2.0f64.sqrt())) + 12.0;