Skip to content

Commit

Permalink
Changes to shadow texture mipmap handling
Browse files Browse the repository at this point in the history
Seems to make SEUS Renewed more consistent and fixes `shadowcolorMipmap`
  • Loading branch information
IMS212 committed Oct 25, 2024
1 parent c554eff commit 9c9fb8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -197,7 +197,7 @@ private static void acceptDepthFilteringSettings(DirectiveHolder directives, Imm
}

private static void acceptColorFilteringSettings(DirectiveHolder directives, Int2ObjectMap<SamplingSettings> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9c9fb8a

Please sign in to comment.