diff --git a/src/main/java/net/coderbot/iris/postprocess/BufferFlipper.java b/src/main/java/net/coderbot/iris/postprocess/BufferFlipper.java index 93e35179c..a4b6f32ef 100644 --- a/src/main/java/net/coderbot/iris/postprocess/BufferFlipper.java +++ b/src/main/java/net/coderbot/iris/postprocess/BufferFlipper.java @@ -13,13 +13,6 @@ public class BufferFlipper { } public void flip(int target) { - // colortex6 carries material/mask data that the gbuffer populates every frame. - // If we allow it to flip, the alternate texture remains empty and later copy-back - // wipes the fresh mask, breaking TAA mask lookups (notably on foliage/transparents). - if (target == 6) { - return; - } - if (!flippedBuffers.remove(target)) { // If the target wasn't in the set, add it to the set. flippedBuffers.add(target); diff --git a/src/main/java/net/coderbot/iris/postprocess/FinalPassRenderer.java b/src/main/java/net/coderbot/iris/postprocess/FinalPassRenderer.java index 50efeab0a..a2d84d12c 100644 --- a/src/main/java/net/coderbot/iris/postprocess/FinalPassRenderer.java +++ b/src/main/java/net/coderbot/iris/postprocess/FinalPassRenderer.java @@ -49,7 +49,6 @@ public class FinalPassRenderer { @Nullable private final Pass finalPass; private final ImmutableList swapPasses; - private final ImmutableSet flippedBuffers; private final GlFramebuffer baseline; private final GlFramebuffer colorHolder; private int lastColorTextureId; @@ -73,7 +72,6 @@ public class FinalPassRenderer { this.noiseTexture = noiseTexture; this.renderTargets = renderTargets; - this.flippedBuffers = flippedBuffers; this.customUniforms = customUniforms; this.finalPass = pack.getCompositeFinal().map(source -> { Pass pass = new Pass(); @@ -103,26 +101,12 @@ public class FinalPassRenderer { // TODO: We don't actually fully swap the content, we merely copy it from alt to main // This works for the most part, but it's not perfect. A better approach would be creating secondary // framebuffers for every other frame, but that would be a lot more complex... + final ImmutableList.Builder swapPasses = ImmutableList.builder(); - // BUG FIX: Swap passes are only needed for NON-flipped buffers that might flip in the future. - // Flipped buffers use ping-pong mechanism - no swap needed. - // Original code created swaps for ALL flippedAtLeastOnce buffers and copied ALT→MAIN, - // which destroyed fresh data in MAIN for currently-flipped buffers (breaking TAA). - // Fixed: Only create swaps for buffers that are in flippedAtLeastOnce but NOT currently flipped. - flippedAtLeastOnce.forEach(i -> { + flippedBuffers.forEach((i) -> { final int target = i; - // Skip buffer 6 (material mask) - gbuffers always write to MAIN, never flipped - if (target == 6) { - return; - } - - // Skip buffers that are currently flipped - they use ping-pong, no swap needed - if (flippedBuffers.contains(target)) { - return; - } - if (buffersToBeCleared.contains(target)) { return; }