From f2df3a9d180aa3d5e8fe478e7aa8c2b0f00723bd Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 29 Jun 2019 22:09:36 +0100 Subject: [PATCH] Block-hopping fix, better dusk shaders --- common/src/sys/phys.rs | 8 +++----- voxygen/shaders/include/sky.glsl | 4 ++-- world/src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index f39fee3751..17a4f6ec19 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -260,10 +260,8 @@ impl<'a> System<'a> for Sys { // If the space above is free... if !collision_with(pos.0 + Vec3::unit_z() * 1.1, near_iter.clone()) && resolve_dir.z == 0.0 - && terrain - .get((pos.0 - Vec3::unit_z()).map(|e| e.floor() as i32)) // Make sure we're close to the ground - .map(|vox| !vox.is_empty()) - .unwrap_or(false) + && vel.0.z <= 0.0 + && collision_with(pos.0 + resolve_dir - Vec3::unit_z() * 1.05, near_iter.clone()) { // ...block-hop! pos.0.z = (pos.0.z + 1.0).ceil(); @@ -284,7 +282,7 @@ impl<'a> System<'a> for Sys { if on_ground { on_grounds.insert(entity, OnGround); // If we're not on the ground but the space below us is free, then "snap" to the ground - } else if collision_with(pos.0 - Vec3::unit_z() * 1.0, near_iter.clone()) + } else if collision_with(pos.0 - Vec3::unit_z() * 1.05, near_iter.clone()) && vel.0.z < 0.0 && vel.0.z > -1.0 && was_on_ground diff --git a/voxygen/shaders/include/sky.glsl b/voxygen/shaders/include/sky.glsl index 23164fa3c9..48b926ab1d 100644 --- a/voxygen/shaders/include/sky.glsl +++ b/voxygen/shaders/include/sky.glsl @@ -45,9 +45,9 @@ vec3 get_sun_diffuse(vec3 norm, float time_of_day) { ), DAY_LIGHT, clamp(-sun_dir.z, 0, 1) - )) / 2.0 + 0.5; + )); - vec3 diffuse_light = (SUN_AMBIANCE + max(dot(-norm, sun_dir), 0.0)) * sun_light * sun_color + PERSISTENT_AMBIANCE; + vec3 diffuse_light = (SUN_AMBIANCE + max(dot(-norm, sun_dir), 0.0) * sun_color) * sun_light + PERSISTENT_AMBIANCE; return diffuse_light; } diff --git a/world/src/lib.rs b/world/src/lib.rs index 515ffd13da..f4aee74a63 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -58,7 +58,7 @@ impl World { pub fn generate_chunk(&self, chunk_pos: Vec2) -> TerrainChunk { let air = Block::empty(); - let stone = Block::new(1, Rgb::new(200, 220, 255)); + let stone = Block::new(2, Rgb::new(200, 220, 255)); let water = Block::new(5, Rgb::new(100, 150, 255)); let chunk_size2d = Vec2::from(TerrainChunkSize::SIZE);