Skip to content

[NF 1.21.1] Invisible screens when menu blur is enabled #1665

Description

@StarliteHeart

Detailed Bug Description

When running FancyMenu alongside certain mods while Minecraft's menu blur is enabled (for any value), screens from those mods will appear as invisible when rendered. This has probably been most commonly observed with Iris Shaders, but I've also discovered it more recently happening with the 1.21.1 version of Tensura: Reincarnated.

This issue appears identical to issue #1509, and there have since been folks who find that disabling blur is the easiest way to address the issue. But since I'm someone who isn't satisfied with just slapping a bandage on an issue without fixing it at its source, I've done some digging on my end to try and provide more information on what helps reproduce the issue, as well as what the root of the cause could be.

The issue seems to mainly manifest within larger modpacks. When running any of these mods alone with FancyMenu, the bug doesn't appear. It's only when enough mods of some specific quality are installed that, after a threshold, these issues appear consistently. While I've not done enough testing to get an incredibly concrete and verbose list of every mod that adds to the issue, I've identified a list of 13 mods that, combined with FancyMenu and one of the two affected mods mentioned above, reliably recreates the issue. Those mods will be listed below in the reproduction steps. A user on the issues threads for Iris performed their own regression and formed their own list of culprits; as they said, it may be something related to the UI features all these mods add which compound into causing the bug.

While it seems unfeasible to fix an issue that only manifests when 14+ additional mods are installed, I did manage to grapple onto something a bit more concrete that could serve as a root for the issue. In both of the mods listed above, each of them, rather than using Minecraft's GameRenderer and its processBlurEffect method, recreate the logic of that function for their own uses. Tensura not only applies a custom blur strength for their own menus but also applies a toggle so that they can disable the blur during certain user actions related to HUD element rearrangement. Iris does the same thing in their ShaderPackScreen in order to create a blur that fades in and out. The key similarity between both of these mods is that they are interacting directly with the blur effect post chain, and I'm wondering if that is somehow messing up the post-processing shaders used by FancyMenu.

I've been able to lightly verify this using a bit of modding knowledge to apply mixins to each of these mods. In both cases, I reworked the code to run the vanilla renderBlurredBackground method instead of their respective custom logics. In both cases, this entirely resolved the issue. So I'm fairly certain that this is definitely the root of the issue. When mods try to change how strong the blur is, or in any way attempt to interact with the blur effect post chain, it breaks the rendering of their screens.

Having said all of this, I'm not sure whether or not there IS a fix for this on the FancyMenu side; while neither of these mods override the renderBackground logic like ModernUI does (as addressed in #971), I'm not sure where a true fix for this really lies. If this is something that can be addressed on the FancyMenu side by adjusting the post-processing blur shaders or otherwise adding in ways to work around these custom post chain adjustments, then great, that'll probably solve it for all mods that perform similar custom blur logic. But if not, if this is an issue that has to be solved on the side of the mods that are having this problem, then I'd like to hear your thoughts on how this could be resolved from their end, which I could then pass along. Any step forward on finding a more permanent fix for this issue (aside from never using menu blur ever again) will be better than letting this linger.

How To Reproduce The Bug

  1. Create a NeoForge 1.21.1 modpack with FancyMenu and the following 13 mods:
  • AppleSkin
  • Artifacts
  • Create
  • Farmer's Delight
  • Iron's Spells n' Spellbooks
  • Paragliders
  • Relics
  • Sophisticated Storage
  • Supplementaries
  • Tom's Simple Storage
  • Twilight Forest
  • Tyz's Skills
  • Xaero's World Map
  1. Add one or both of Tensura: Reincarnated and/or Iris Shaders to the modpack.
  2. Start the game and create a new world.
  3. Check the respective screens for each mod.
  • For Tensura, once you have selected your race, open the main Tensura menu with B. Depending on the mods loaded, this may render correctly, or you may only see the evolution bar. If it does render correctly, you can open the settings menu using the Gear in the upper right of this screen, and the render issue should manifest more clearly there.
  • For Iris Shaders, when you can access the pause menu in-world, go to Options -> Video Settings -> Shader Packs to find the Shader Pack screen. Because of the bug, it should fail to render.

Installed Mods

  • Essential mod installed?
  • Optifine installed?
  • Sinytra Connector mod installed?

Minecraft Version

1.21.1

FancyMenu Version

3.9.1

Mod Loader

NeoForge

Mod Loader Version

21.1.228

Fabric API Version

No response

Latest Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions