Skip to content

Fix Iris compat leaving Iris's framebuffer bound and drawing to the wrong colortex0 - #213

Open
CuddlesPrime wants to merge 1 commit into
FoundryMC:1.21from
CuddlesPrime:iris-framebuffer-fix
Open

CuddlesPrime wants to merge 1 commit into
FoundryMC:1.21from
CuddlesPrime:iris-framebuffer-fix

Conversation

@CuddlesPrime

Copy link
Copy Markdown

With an Iris shader pack, Veil shaders drawn through ShaderWrapperMixin break GUIs and don't show up (e.g. Create: Aeronautics' Hot Air Burner flame).

Problems

  • Iris's framebuffer is never unbound. @Share("drawn") doesn't carry from apply() to clear() (they're different methods), so AdvancedFbo.unbind() never runs. In GUIs, everything drawn afterwards goes offscreen (Aeronautics ponders and inventory items).
  • Wrong colortex0 copy. The simple framebuffer always uses colortex0's main texture, but packs that flip colortex0 (e.g. Complementary) draw the world into the alt one, so the draw is lost.
  • Redirects too often. It also redirects in GUIs and during the shadow pass.

Fix

In ShaderWrapperMixin (NeoForge and Fabric):

  • Save the bound framebuffers in apply and restore them in clear.
  • Redirect only when shouldOverrideShaders() is true and it isn't the shadow pass, matching Iris's own handling of unknown shaders.
  • Use IrisRenderingPipeline.bindDefault(), which picks the correct colortex0 copy.

IrisRenderingPipelineMixin and IrisRenderingPipelineExtension are no longer used and are removed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant