From a90ceddde0569d387852e91b3df7c98942e94cf8 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 27 Sep 2019 12:46:20 +0100 Subject: [PATCH] Fixed cold near oceans, faster meshing --- voxygen/src/mesh/vol.rs | 7 ++----- world/src/sim/mod.rs | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/voxygen/src/mesh/vol.rs b/voxygen/src/mesh/vol.rs index f3da805ffa..515a306079 100644 --- a/voxygen/src/mesh/vol.rs +++ b/voxygen/src/mesh/vol.rs @@ -63,10 +63,7 @@ fn get_ao_quad( if s1 && s2 { 0.0 } else { - let corner = vol - .get(pos + shift + offs[0] + offs[1]) - .map(&is_opaque) - .unwrap_or(false); + let corner = vox_opaque(shift + offs[0] + offs[1]); // Map both 1 and 2 neighbors to 0.5 occlusion. if s1 || s2 || corner { 0.5 @@ -131,7 +128,7 @@ fn create_quad, Vec3, Rgb, f32, f32) -> P let darkness = darkness_ao.map(|e| e.0); let ao = darkness_ao.map(|e| e.1); - let ao_map = ao.map(|e| e); //0.05 + e.powf(1.2) * 0.95); + let ao_map = ao.map(|e| 0.05 + e.powf(1.2) * 0.95); if ao[0].min(ao[2]).min(darkness[0]).min(darkness[2]) < ao[1].min(ao[3]).min(darkness[1]).min(darkness[3]) diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index a2a8d0598d..1cf62479d3 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -246,7 +246,8 @@ impl WorldSim { for y in pos.y - 1..=pos.y + 1 { if x >= 0 && y >= 0 && x < WORLD_SIZE.x as i32 && y < WORLD_SIZE.y as i32 { let posi = vec2_as_uniform_idx(Vec2::new(x, y)); - if alt[posi].1.mul(CONFIG.mountain_scale) > 0.0 { + if alt[posi].1.mul(CONFIG.mountain_scale) > -8.0 { + // Account for warping in later stages return false; } }