From 6eca28113430962fc6d8a9961db21ccc70d86596 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Wed, 24 Nov 2021 11:12:59 -0800 Subject: [PATCH] Hack for contraption cutout --- .../flywheel/shaders/context/contraption.glsl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 61d0b80c2..42d22c52d 100644 --- a/src/main/resources/assets/create/flywheel/shaders/context/contraption.glsl +++ b/src/main/resources/assets/create/flywheel/shaders/context/contraption.glsl @@ -40,6 +40,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 + in vec3 BoxCoord; out vec4 FragColor; @@ -57,6 +65,12 @@ void FLWFinalizeColor(vec4 color) { color.a = a; #endif + #if defined(ALPHA_DISCARD) + if (color.a < ALPHA_DISCARD) { + discard; + } + #endif + FragColor = color; }