diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index ab9861556f..7c3b531206 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -66,7 +66,21 @@ impl<'a> Sampler for BlockGen<'a> { .mul((chaos - 0.1).max(0.0)) .mul(90.0); - let height = alt + warp; + let cliff = (self.world.sim() + .gen_ctx + .warp_nz + .get((wposf.div(Vec3::new(150.0, 150.0, 150.0))).into_array()) + as f32) + //.add(0.6) + .mul(130.0); + + let is_cliff = (self.world.sim() + .gen_ctx + .warp_nz + .get((wposf.div(Vec3::new(100.0, 100.0, 100.0))).into_array()) + as f32) > 0.0;//4; + + let height = alt + warp + if is_cliff { cliff } else { 0.0 }; // Sample blocks diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index f0541d3c17..ec6e91abe0 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -140,7 +140,7 @@ impl WorldSim { } } -const Z_TOLERANCE: (f32, f32) = (128.0, 64.0); +const Z_TOLERANCE: (f32, f32) = (128.0, 128.0); pub struct SimChunk { pub chaos: f32, @@ -179,7 +179,7 @@ impl SimChunk { let alt_base = alt_base .mul(0.4) .add(alt_base.mul(128.0).sin().mul(0.005)) - .mul(800.0); + .mul(400.0); let alt_main = (gen_ctx.alt_nz.get((wposf.div(1_000.0)).into_array()) as f32) .abs()