Fix shaders when far clip fading is active

This commit is contained in:
James Seibel
2025-11-15 18:20:47 -06:00
parent 4b20637e47
commit 42dc0903de
2 changed files with 4 additions and 7 deletions
@@ -110,8 +110,6 @@ public class DhFadeRenderer
public void render(Mat4f mcModelViewMatrix, Mat4f mcProjectionMatrix, float partialTicks, IProfilerWrapper profiler)
{
GLState mcState = new GLState();
try
{
profiler.push("Fade Generate");
@@ -149,10 +147,6 @@ public class DhFadeRenderer
}
finally
{
// make sure we always revert to MC's state to prevent GL state corruption
// this is especially important on MC 1.16.5 or when other rendering mods are present
mcState.restore();
profiler.pop();
}
}
@@ -243,7 +243,10 @@ public class LodRenderer
}
// far plane clip fading
if (Config.Client.Advanced.Graphics.Quality.dhFadeFarClipPlane.get())
if (Config.Client.Advanced.Graphics.Quality.dhFadeFarClipPlane.get()
// the fade shader messes with the GL state in a way Iris doesn't like,
// so skip it if a shader is active
&& !IRIS_ACCESSOR.isShaderPackInUse())
{
profiler.popPush("Fade Far Clip Fade");
DhFadeRenderer.INSTANCE.render(