diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 50180e246c..f62b23e90b 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -171,9 +171,9 @@ impl<'a> BlockGen<'a> { (true, alt, CONFIG.sea_level /*water_level*/) } else { // Apply warping - let warp = (world.sim().gen_ctx.warp_nz.get(wposf.div(16.0)) as f32) + let warp = (world.sim().gen_ctx.warp_nz.get(wposf.div(24.0)) as f32) .mul((chaos - 0.1).max(0.0)) - .mul(15.0); + .mul(30.0); let height = if (wposf.z as f32) < alt + warp - 10.0 { // Shortcut cliffs diff --git a/world/src/util/fast_noise.rs b/world/src/util/fast_noise.rs index d2204280be..e25a61e980 100644 --- a/world/src/util/fast_noise.rs +++ b/world/src/util/fast_noise.rs @@ -23,14 +23,16 @@ impl Sampler<'static> for FastNoise { type Sample = f32; fn get(&self, pos: Self::Index) -> Self::Sample { - let v000 = self.noise_at(pos.map(|e| e.floor() as i32) + Vec3::new(0, 0, 0)); - let v100 = self.noise_at(pos.map(|e| e.floor() as i32) + Vec3::new(1, 0, 0)); - let v010 = self.noise_at(pos.map(|e| e.floor() as i32) + Vec3::new(0, 1, 0)); - let v110 = self.noise_at(pos.map(|e| e.floor() as i32) + Vec3::new(1, 1, 0)); - let v001 = self.noise_at(pos.map(|e| e.floor() as i32) + Vec3::new(0, 0, 1)); - let v101 = self.noise_at(pos.map(|e| e.floor() as i32) + Vec3::new(1, 0, 1)); - let v011 = self.noise_at(pos.map(|e| e.floor() as i32) + Vec3::new(0, 1, 1)); - let v111 = self.noise_at(pos.map(|e| e.floor() as i32) + Vec3::new(1, 1, 1)); + let near_pos = pos.map(|e| e.floor() as i32); + + let v000 = self.noise_at(near_pos + Vec3::new(0, 0, 0)); + let v100 = self.noise_at(near_pos + Vec3::new(1, 0, 0)); + let v010 = self.noise_at(near_pos + Vec3::new(0, 1, 0)); + let v110 = self.noise_at(near_pos + Vec3::new(1, 1, 0)); + let v001 = self.noise_at(near_pos + Vec3::new(0, 0, 1)); + let v101 = self.noise_at(near_pos + Vec3::new(1, 0, 1)); + let v011 = self.noise_at(near_pos + Vec3::new(0, 1, 1)); + let v111 = self.noise_at(near_pos + Vec3::new(1, 1, 1)); let factor = pos.map(|e| 0.5 - (e.fract() as f32 * f32::consts::PI).cos() * 0.5);