From ea930ad917e5f169f2fb84137426482447c9f967 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Thu, 29 May 2025 18:51:31 +1000 Subject: [PATCH] Fix flickering due to incorrect state restoration --- .../voxy/client/core/model/bakery/ModelTextureBakery.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/me/cortex/voxy/client/core/model/bakery/ModelTextureBakery.java b/src/main/java/me/cortex/voxy/client/core/model/bakery/ModelTextureBakery.java index 674b2cd4..b26ce43f 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/bakery/ModelTextureBakery.java +++ b/src/main/java/me/cortex/voxy/client/core/model/bakery/ModelTextureBakery.java @@ -21,6 +21,7 @@ import net.minecraft.world.biome.ColorResolver; import net.minecraft.world.chunk.light.LightingProvider; import org.jetbrains.annotations.Nullable; import org.joml.Matrix4f; +import org.lwjgl.opengl.GL14; import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.opengl.GL14C.glBlendFuncSeparate; @@ -292,6 +293,10 @@ public class ModelTextureBakery { glBindFramebuffer(GL_FRAMEBUFFER, this.capture.framebuffer.id); glClearDepth(1); glClear(GL_DEPTH_BUFFER_BIT); + if (layer == RenderLayer.getTranslucent()) { + //reset the blend func + GL14.glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } }