From 7334f9782c7665dc8848cec7b3f4258ba25ede96 Mon Sep 17 00:00:00 2001 From: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon, 27 Jan 2020 12:12:38 +0000 Subject: [PATCH] Made depths behave nicer when zoomed really far out --- assets/voxygen/shaders/figure-vert.glsl | 2 +- assets/voxygen/shaders/fluid-vert.glsl | 2 +- assets/voxygen/shaders/sprite-vert.glsl | 2 +- assets/voxygen/shaders/terrain-vert.glsl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/voxygen/shaders/figure-vert.glsl b/assets/voxygen/shaders/figure-vert.glsl index 01261fb948..18492b71d1 100644 --- a/assets/voxygen/shaders/figure-vert.glsl +++ b/assets/voxygen/shaders/figure-vert.glsl @@ -43,5 +43,5 @@ void main() { ).xyz); gl_Position = all_mat * vec4(f_pos, 1); - gl_Position.z = 1.0 / (1.0 - gl_Position.z - 10.0); + gl_Position.z = -100.0 / (gl_Position.z + 500.0); } diff --git a/assets/voxygen/shaders/fluid-vert.glsl b/assets/voxygen/shaders/fluid-vert.glsl index 44ca08f3ca..98ee1f9203 100644 --- a/assets/voxygen/shaders/fluid-vert.glsl +++ b/assets/voxygen/shaders/fluid-vert.glsl @@ -40,5 +40,5 @@ void main() { gl_Position = all_mat * vec4(f_pos, 1); - gl_Position.z = 1.0 / (1.0 - gl_Position.z - 10.0); + gl_Position.z = -100.0 / (gl_Position.z + 500.0); } diff --git a/assets/voxygen/shaders/sprite-vert.glsl b/assets/voxygen/shaders/sprite-vert.glsl index ed3f84ea86..8117b656a9 100644 --- a/assets/voxygen/shaders/sprite-vert.glsl +++ b/assets/voxygen/shaders/sprite-vert.glsl @@ -52,5 +52,5 @@ void main() { gl_Position = all_mat * vec4(f_pos, 1); - gl_Position.z = 1.0 / (1.0 - gl_Position.z - 10.0); + gl_Position.z = -100.0 / (gl_Position.z + 500.0); } diff --git a/assets/voxygen/shaders/terrain-vert.glsl b/assets/voxygen/shaders/terrain-vert.glsl index fedaafb9c1..510692ce52 100644 --- a/assets/voxygen/shaders/terrain-vert.glsl +++ b/assets/voxygen/shaders/terrain-vert.glsl @@ -32,5 +32,5 @@ void main() { gl_Position = all_mat * vec4(f_pos, 1); - gl_Position.z = 1.0 / (1.0 - gl_Position.z - 10.0); + gl_Position.z = -100.0 / (gl_Position.z + 500.0); }