Fabric Rendering API breaking vanilla core shaders
MrKinau opened this issue · 10 comments
Description
Since 0.116.0+1.21.4 several UI elements no longer render on the vanilla positions. I have not tested every UI element, only noticed it being off at the player list no longer rendering at z-Index 2800, instead it renders at z-index 1600.
Steps to Reproduce
- Install Fabric API
0.116.0+1.21.4 - Install this resource pack test.zip
- Join a multiplayer server
- Observe the player list being colored in magenta, instead of cyan.
Expected Behavior
The player list should be colored in cyan (screenshot vanilla):

Observed Behavior
The player list is colored in magenta (screenshot fabric api 0.116.0+1.21.4):

Additional Info
This change in z-index did not occur on fabric api 0.115.1+1.21.4.
Probably caused by the new HUD rendering API. Is this really an issue in practice? Mods are likely to insert HUD layers that would change the z offset anyway.
Probably caused by the new HUD rendering API. Is this really an issue in practice? Mods are likely to insert HUD layers that would change the z offset anyway.
For me it became an issue as I do use shaders to change the z index of the player list and I guess I'm not the only one who likes doing so. Imo no mod should change z indexes of any vanilla UI component as I don't see any reason of doing so.
This is a discussed effect of the hud api. You can use the hud api or mixins instead of relying on the z height. Neoforge also does not guarantee z height.
Can confirm described behavior. The demo timer should render at z = 1600, but with the new api, player list (which is much later) renders at z = 1600.
I'm not speaking as a mod developer. I am speaking as a server with custom resource pack. Of course I can add the z index for fabric api to my resource pack shader, but I would prefer if fabric api won't change vanilla UI elements.
The API was designed not to touch vanilla if no mods are doing anything to it, if im reading this issue correctly there are changes to the vanilla HUD.
This is correct.
The API was designed not to touch vanilla if no mods are doing anything to it, if im reading this issue correctly there are changes to the vanilla HUD.
Hey, please can you try this build here, I think I may have fixed it:
fabric-api-0.116.0+local-fix-4435.jar.zip (Extract the .jar from the zip)