From edd3455d5161792d87ddc8eadc0ecbad5532b284 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 21 Feb 2020 14:40:19 +0000 Subject: [PATCH] Fixed LoD z depth, added sea level offset --- assets/voxygen/shaders/include/lod.glsl | 2 +- assets/voxygen/shaders/lod-terrain-vert.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/voxygen/shaders/include/lod.glsl b/assets/voxygen/shaders/include/lod.glsl index 49354b1131..ff14eefea6 100644 --- a/assets/voxygen/shaders/include/lod.glsl +++ b/assets/voxygen/shaders/include/lod.glsl @@ -8,7 +8,7 @@ vec2 pos_to_uv(vec2 pos) { } float alt_at(vec2 pos) { - return texture(t_map, pos_to_uv(pos)).a * (1450.0); + return texture(t_map, pos_to_uv(pos)).a * (1310.0) + 140.0; return 0.0 + pow(texture(t_noise, pos * 0.00005).x * 1.4, 3.0) * 1000.0 diff --git a/assets/voxygen/shaders/lod-terrain-vert.glsl b/assets/voxygen/shaders/lod-terrain-vert.glsl index d319c9430e..df3ac04980 100644 --- a/assets/voxygen/shaders/lod-terrain-vert.glsl +++ b/assets/voxygen/shaders/lod-terrain-vert.glsl @@ -25,5 +25,5 @@ void main() { proj_mat * view_mat * vec4(f_pos, 1); - gl_Position.z = 1.0 / (1.0 - gl_Position.z * 0.001 - 100.0); + gl_Position.z = -1000.0 / (gl_Position.z + 10000.0); }