From b0a16196987f2e7b5fcec143c58335b925b39c6d Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 25 Sep 2019 14:38:58 +0100 Subject: [PATCH] Fixed shadow distance culling --- voxygen/src/scene/mod.rs | 2 +- world/src/column/mod.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index 32861d1e02..02582ffe19 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -223,7 +223,7 @@ impl Scene { .join() .filter(|(pos, _)| { (pos.0.distance_squared(player_pos) as f32) - < self.loaded_distance.powf(2.0).min(SHADOW_MAX_DIST) + SHADOW_DIST_RADIUS + < (self.loaded_distance.min(SHADOW_MAX_DIST) + SHADOW_DIST_RADIUS).powf(2.0) }) .map(|(pos, scale)| Shadow::new(pos.0, scale.map(|s| s.0).unwrap_or(1.0))) .collect::>(); diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 7768781d63..745fbb89eb 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -207,6 +207,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { let wposf3d = Vec3::new(wposf.x, wposf.y, alt as f64); let marble_small = (sim.gen_ctx.hill_nz.get((wposf3d.div(3.0)).into_array()) as f32) + .powf(3.0) .add(1.0) .mul(0.5); let marble = (sim.gen_ctx.hill_nz.get((wposf3d.div(48.0)).into_array()) as f32)