From 47f8d3f1b5adf7fdd0388b77ce24b4d1fdae639a Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Sat, 11 Dec 2021 17:31:10 -0800 Subject: [PATCH] Cylindrical fog - having the world position is very nice - mojang manages to do multiple matrix multiplications --- .../assets/create/flywheel/shaders/context/contraption.glsl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/resources/assets/create/flywheel/shaders/context/contraption.glsl b/src/main/resources/assets/create/flywheel/shaders/context/contraption.glsl index 42d22c52d..03ec29fbb 100644 --- a/src/main/resources/assets/create/flywheel/shaders/context/contraption.glsl +++ b/src/main/resources/assets/create/flywheel/shaders/context/contraption.glsl @@ -30,9 +30,7 @@ void FLWFinalizeWorldPos(inout vec4 worldPos) { BoxCoord = (worldPos.xyz - uLightBoxMin) / uLightBoxSize; - #if defined(USE_FOG) - FragDistance = length(worldPos.xyz); - #endif + FragDistance = max(length(worldPos.xz), abs(worldPos.y)); // cylindrical fog gl_Position = uViewProjection * worldPos; } @@ -57,13 +55,11 @@ vec4 FLWBlockTexture(vec2 texCoords) { } void FLWFinalizeColor(vec4 color) { - #if defined(USE_FOG) float a = color.a; float fog = clamp(FLWFogFactor(), 0., 1.); color = mix(uFogColor, color, fog); color.a = a; - #endif #if defined(ALPHA_DISCARD) if (color.a < ALPHA_DISCARD) {