From a34aff3a8b1e1fe519994797e44292c223bfd4a8 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 6 Jun 2019 21:56:16 +0100 Subject: [PATCH] Prevented rock smearing --- world/src/sampler.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/world/src/sampler.rs b/world/src/sampler.rs index ca3ac037cf..0c09743e0b 100644 --- a/world/src/sampler.rs +++ b/world/src/sampler.rs @@ -43,17 +43,17 @@ impl<'a> Sampler<'a> { let rockiness = sim.get_interpolated(wpos, |chunk| chunk.rockiness)?; let tree_density = sim.get_interpolated(wpos, |chunk| chunk.tree_density)?; - let rock = (sim.gen_ctx.small_nz.get((wposf.div(100.0)).into_array()) as f32) - .mul(rockiness) - .sub(0.35) - .max(0.0) - .mul(6.0); - let alt = sim.get_interpolated(wpos, |chunk| chunk.alt)? + sim.gen_ctx.small_nz.get((wposf.div(256.0)).into_array()) as f32 * chaos.max(0.2) * 64.0; + let rock = (sim.gen_ctx.small_nz.get(Vec3::new(wposf.x, wposf.y, alt as f64).div(100.0).into_array()) as f32) + .mul(rockiness) + .sub(0.35) + .max(0.0) + .mul(6.0); + let wposf3d = Vec3::new(wposf.x, wposf.y, alt as f64); let marble = (sim.gen_ctx.hill_nz.get((wposf3d.div(48.0)).into_array()) as f32)