aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-30 12:11:16 +0200
committermakamys <makamys@outlook.com>2022-06-30 12:11:35 +0200
commit88622cb5c118bb73a30da4716f8e4f8c677622a7 (patch)
treecf06fc4dc5a96d9936e031f217beb6c3cc38b40a /src
parent965636d583a91c3420ec69b81c47b5b961eeb7a7 (diff)
downloadNeodymium-88622cb5c118bb73a30da4716f8e4f8c677622a7.tar.gz
Neodymium-88622cb5c118bb73a30da4716f8e4f8c677622a7.tar.bz2
Neodymium-88622cb5c118bb73a30da4716f8e4f8c677622a7.zip
Clean up vertex shader
Diffstat (limited to 'src')
-rw-r--r--src/main/resources/shaders/chunk.vert3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/resources/shaders/chunk.vert b/src/main/resources/shaders/chunk.vert
index b0d9177..823b546 100644
--- a/src/main/resources/shaders/chunk.vert
+++ b/src/main/resources/shaders/chunk.vert
@@ -47,8 +47,9 @@ void main()
float s = fogStartEnd.x;
float e = fogStartEnd.y;
vec4 eyePos = (modelView * (vec4(aPos - playerPos, 1.0) + vec4(0, 0.12, 0, 0)));
+ float c = length(eyePos);
- float fogFactor = clamp((e - length(eyePos)) / (e - s), 0, 1);
+ float fogFactor = clamp((e - c) / (e - s), 0, 1);
FogFactor = fogFactor;
} else {