From 0c6a75ade5d5fb7129bfc92ed86945175bb3ad21 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Thu, 16 Sep 2021 20:53:35 -0700 Subject: [PATCH] Always use discard --- .../flywheel/flywheel/shaders/context/world.glsl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/resources/assets/flywheel/flywheel/shaders/context/world.glsl b/src/main/resources/assets/flywheel/flywheel/shaders/context/world.glsl index e21ee6a9a..beb4319f2 100644 --- a/src/main/resources/assets/flywheel/flywheel/shaders/context/world.glsl +++ b/src/main/resources/assets/flywheel/flywheel/shaders/context/world.glsl @@ -26,6 +26,14 @@ void FLWFinalizeWorldPos(inout vec4 worldPos) { #elif defined(FRAGMENT_SHADER) #use "flywheel:core/lightutil.glsl" +#define ALPHA_DISCARD 0.1 +// +//#if defined(ALPHA_DISCARD) +//#if defined(GL_ARB_conservative_depth) +//layout (depth_greater) out float gl_FragDepth; +//#endif +//#endif + vec4 FLWBlockTexture(vec2 texCoords) { return texture2D(uBlockAtlas, texCoords); } @@ -39,6 +47,12 @@ void FLWFinalizeColor(vec4 color) { color.a = a; #endif + #if defined(ALPHA_DISCARD) + if (color.a < ALPHA_DISCARD) { + discard; + } + #endif + gl_FragColor = color; }