From 9c9fb8a0eae86bebf620d5b9c05307e2db8daf7a Mon Sep 17 00:00:00 2001 From: IMS212 Date: Fri, 25 Oct 2024 15:54:41 -0700 Subject: [PATCH] Changes to shadow texture mipmap handling Seems to make SEUS Renewed more consistent and fixes `shadowcolorMipmap` --- .../iris/shaderpack/properties/PackShadowDirectives.java | 4 ++-- .../net/irisshaders/iris/shadows/ShadowCompositeRenderer.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/net/irisshaders/iris/shaderpack/properties/PackShadowDirectives.java b/common/src/main/java/net/irisshaders/iris/shaderpack/properties/PackShadowDirectives.java index 043e154f54..ea7fff28cd 100644 --- a/common/src/main/java/net/irisshaders/iris/shaderpack/properties/PackShadowDirectives.java +++ b/common/src/main/java/net/irisshaders/iris/shaderpack/properties/PackShadowDirectives.java @@ -171,7 +171,7 @@ private static void acceptColorMipmapSettings(DirectiveHolder directives, Int2Ob directives.acceptConstBooleanDirective("generateShadowColorMipmap", mipmap -> samplers.forEach((i, sampler) -> sampler.setMipmap(mipmap))); // Find any per-sampler overrides for the shadow depth mipmap setting - for (int i = 0; i < samplers.size(); i++) { + for (int i = 0; i < PackShadowDirectives.MAX_SHADOW_COLOR_BUFFERS_IRIS; i++) { String name = "shadowcolor" + i + "Mipmap"; directives.acceptConstBooleanDirective(name, samplers.computeIfAbsent(i, sa -> new SamplingSettings())::setMipmap); @@ -197,7 +197,7 @@ private static void acceptDepthFilteringSettings(DirectiveHolder directives, Imm } private static void acceptColorFilteringSettings(DirectiveHolder directives, Int2ObjectMap samplers) { - for (int i = 0; i < samplers.size(); i++) { + for (int i = 0; i < PackShadowDirectives.MAX_SHADOW_COLOR_BUFFERS_IRIS; i++) { String name = "shadowcolor" + i + "Nearest"; directives.acceptConstBooleanDirective(name, samplers.computeIfAbsent(i, sa -> new SamplingSettings())::setNearest); diff --git a/common/src/main/java/net/irisshaders/iris/shadows/ShadowCompositeRenderer.java b/common/src/main/java/net/irisshaders/iris/shadows/ShadowCompositeRenderer.java index 6f9f90b247..2a79e67945 100644 --- a/common/src/main/java/net/irisshaders/iris/shadows/ShadowCompositeRenderer.java +++ b/common/src/main/java/net/irisshaders/iris/shadows/ShadowCompositeRenderer.java @@ -233,12 +233,15 @@ public void renderAll() { ProgramUniforms.clearActiveUniforms(); GlStateManager._glUseProgram(0); + // TODO IMS: Apparantly we are not supposed to do this for shadowcomp... + /* for (int i = 0; i < renderTargets.getRenderTargetCount(); i++) { // Reset mipmapping states at the end of the frame. if (renderTargets.get(i) != null) { resetRenderTarget(renderTargets.get(i)); } } + */ RenderSystem.activeTexture(GL15C.GL_TEXTURE0); }