From 8ef5c60b72ff44b50d3bf5597abb02ce9047bab6 Mon Sep 17 00:00:00 2001 From: Imbris Date: Fri, 10 Sep 2021 11:55:07 -0400 Subject: [PATCH] Disable visuals that block seeing camera clipping since they cause flickering, raise max zoom cap with camera, fix overflow issue --- assets/voxygen/shaders/postprocess-frag.glsl | 9 +++++---- voxygen/src/scene/figure/mod.rs | 6 +++--- voxygen/src/scene/mod.rs | 4 +++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/assets/voxygen/shaders/postprocess-frag.glsl b/assets/voxygen/shaders/postprocess-frag.glsl index 2d478578fe..0f8f91484c 100644 --- a/assets/voxygen/shaders/postprocess-frag.glsl +++ b/assets/voxygen/shaders/postprocess-frag.glsl @@ -185,10 +185,11 @@ void main() { // float bright_color = (bright_color0 + bright_color1 + bright_color2 + bright_color3 + bright_color4) / 5.0; - if (medium.x == 2u) { - tgt_color = vec4(0, 0.005, 0.01, 1) * (1 + hash_fast(uvec3(vec3(uv * screen_res.xy / 32.0, 0)))); - return; - } + // TODO: this causes flickering when the camera is moving into and out of solid blocks, resolve before uncommenting + // if (medium.x == 2u) { + // tgt_color = vec4(0, 0.005, 0.01, 1) * (1 + hash_fast(uvec3(vec3(uv * screen_res.xy / 32.0, 0)))); + // return; + // } vec4 aa_color = aa_apply(t_src_color, s_src_color, uv * screen_res.xy, screen_res.xy); diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 26b4c755eb..9c409129f5 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -655,10 +655,10 @@ impl FigureMgr { const MIN_PERFECT_RATE_DIST: f32 = 100.0; if (i as u64 + tick) - % (1 + ((pos.0.distance_squared(focus_pos).powf(0.25) - - MIN_PERFECT_RATE_DIST.sqrt()) - .max(0.0) + % (((pos.0.distance_squared(focus_pos).powf(0.25) - MIN_PERFECT_RATE_DIST.sqrt()) + .max(0.0) / 3.0) as u64) + .saturating_add(1) != 0 { continue; diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index a666b2d407..97399de4bb 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -41,6 +41,8 @@ use num::traits::{Float, FloatConst}; use specs::{Entity as EcsEntity, Join, WorldExt}; use vek::*; +const ZOOM_CAP: f32 = 10000.0; + // TODO: Don't hard-code this. const CURSOR_PAN_SCALE: f32 = 0.005; @@ -357,7 +359,7 @@ impl Scene { // when zooming in the distance the camera travelles should be based on the // final distance. This is to make sure the camera travelles the // same distance when zooming in and out - let cap = (!client.is_moderator()).then_some(30.0); + let cap = (!client.is_moderator()).then_some(ZOOM_CAP); if delta < 0.0 { self.camera.zoom_switch( // Thank you Imbris for doing the math