From dfdb8abf492c68a8417faa175547d956db01c9e3 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Sat, 11 Dec 2021 22:03:53 -0800 Subject: [PATCH] Use GL_ARB_conservative_depth when possible - Allows the depth test to discard fragments before the fragment shader is run --- .../flywheel/shaders/context/contraption.glsl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 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 03ec29fbb..df76e3c12 100644 --- a/src/main/resources/assets/create/flywheel/shaders/context/contraption.glsl +++ b/src/main/resources/assets/create/flywheel/shaders/context/contraption.glsl @@ -39,12 +39,13 @@ void FLWFinalizeWorldPos(inout vec4 worldPos) { #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 +// optimize discard usage +#if defined(ALPHA_DISCARD) +#if defined(GL_ARB_conservative_depth) +#extension GL_ARB_conservative_depth : enable +layout (depth_greater) out float gl_FragDepth; +#endif +#endif in vec3 BoxCoord;