From 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 21 Feb 2020 14:54:37 +0000 Subject: [PATCH] Better blending between LoD and terrain border --- assets/voxygen/shaders/figure-vert.glsl | 1 + assets/voxygen/shaders/lod-terrain-vert.glsl | 2 +- assets/voxygen/shaders/sprite-vert.glsl | 1 + assets/voxygen/shaders/terrain-vert.glsl | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/voxygen/shaders/figure-vert.glsl b/assets/voxygen/shaders/figure-vert.glsl index eced69e5ea..1bb8eeaef7 100644 --- a/assets/voxygen/shaders/figure-vert.glsl +++ b/assets/voxygen/shaders/figure-vert.glsl @@ -33,6 +33,7 @@ void main() { f_pos = ( combined_mat * vec4(v_pos, 1)).xyz; + f_pos.z -= 1.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0); f_col = v_col; diff --git a/assets/voxygen/shaders/lod-terrain-vert.glsl b/assets/voxygen/shaders/lod-terrain-vert.glsl index df3ac04980..84456c45aa 100644 --- a/assets/voxygen/shaders/lod-terrain-vert.glsl +++ b/assets/voxygen/shaders/lod-terrain-vert.glsl @@ -17,7 +17,7 @@ out float f_light; void main() { f_pos = lod_pos(v_pos + vec2(0, -v_pos.x * 0.5)); - f_pos.z -= 5.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.9), 20.0); + f_pos.z -= 1.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0); f_light = 1.0; diff --git a/assets/voxygen/shaders/sprite-vert.glsl b/assets/voxygen/shaders/sprite-vert.glsl index 39dbdb003b..6838b47669 100644 --- a/assets/voxygen/shaders/sprite-vert.glsl +++ b/assets/voxygen/shaders/sprite-vert.glsl @@ -30,6 +30,7 @@ void main() { vec3 sprite_pos = (inst_mat * vec4(0, 0, 0, 1)).xyz; f_pos = (inst_mat * vec4(v_pos * SCALE, 1)).xyz; + f_pos.z -= 1.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0); // Wind waving f_pos += inst_wind_sway * vec3( diff --git a/assets/voxygen/shaders/terrain-vert.glsl b/assets/voxygen/shaders/terrain-vert.glsl index afb0ac114e..b1b46a6836 100644 --- a/assets/voxygen/shaders/terrain-vert.glsl +++ b/assets/voxygen/shaders/terrain-vert.glsl @@ -21,7 +21,7 @@ void main() { f_pos = vec3((uvec3(v_pos_norm) >> uvec3(0, 8, 16)) & uvec3(0xFFu, 0xFFu, 0x1FFFu)) + model_offs; f_pos.z *= min(1.0001 - 0.02 / pow(tick.x - load_time, 10.0), 1.0); - f_pos.z -= 5.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.9), 20.0); + f_pos.z -= 1.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0); f_col = vec3((uvec3(v_col_light) >> uvec3(8, 16, 24)) & uvec3(0xFFu)) / 255.0;