From 3559252a5e50ad240c6b340eef7987b7aef1389f Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 17 Mar 2020 13:29:42 +0000 Subject: [PATCH 1/3] Nicer point lights --- assets/voxygen/shaders/include/light.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/voxygen/shaders/include/light.glsl b/assets/voxygen/shaders/include/light.glsl index e937535b78..1496dd2d42 100644 --- a/assets/voxygen/shaders/include/light.glsl +++ b/assets/voxygen/shaders/include/light.glsl @@ -25,7 +25,7 @@ vec3 illuminate(vec3 color, vec3 light, vec3 diffuse, vec3 ambience) { } float attenuation_strength(vec3 rpos) { - return 1.0 / (rpos.x * rpos.x + rpos.y * rpos.y + rpos.z * rpos.z); + return 1.0 / pow(rpos.x * rpos.x + rpos.y * rpos.y + rpos.z * rpos.z, 0.6); } vec3 light_at(vec3 wpos, vec3 wnorm) { From 4580752e78e467805c86616cdaeabc7c02f62e48 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 17 Mar 2020 14:14:20 +0000 Subject: [PATCH 2/3] Fixed remaining pathfinding issues --- common/src/path.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/common/src/path.rs b/common/src/path.rs index 1d21b51819..edce17249e 100644 --- a/common/src/path.rs +++ b/common/src/path.rs @@ -218,8 +218,26 @@ where ]; DIRS.iter() - .map(move |dir| pos + dir) - .filter(move |pos| is_walkable(pos)) + .map(move |dir| (pos, dir)) + .filter(move |(pos, dir)| { + is_walkable(pos) + && ((dir.z < 1 + || vol + .get(pos + Vec3::unit_z() * 2) + .map(|b| !b.is_solid()) + .unwrap_or(true)) + && (dir.z < 2 + || vol + .get(pos + Vec3::unit_z() * 3) + .map(|b| !b.is_solid()) + .unwrap_or(true)) + && (dir.z > 0 + || vol + .get(pos + *dir + Vec3::unit_z() * 2) + .map(|b| !b.is_solid()) + .unwrap_or(true))) + }) + .map(move |(pos, dir)| pos + dir) .chain( DIAGONALS .iter() From 95eeb7e145e2b1cf064ad056d837d97291ebd26e Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 17 Mar 2020 16:37:39 +0000 Subject: [PATCH 3/3] Omitted unnecessary test --- common/src/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/path.rs b/common/src/path.rs index edce17249e..85e8f174af 100644 --- a/common/src/path.rs +++ b/common/src/path.rs @@ -231,7 +231,7 @@ where .get(pos + Vec3::unit_z() * 3) .map(|b| !b.is_solid()) .unwrap_or(true)) - && (dir.z > 0 + && (dir.z >= 0 || vol .get(pos + *dir + Vec3::unit_z() * 2) .map(|b| !b.is_solid())