Fabric API

Fabric API

152M Downloads

Fabric Rendering API breaking vanilla core shaders

MrKinau opened this issue · 10 comments

commented

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

  1. Install Fabric API 0.116.0+1.21.4
  2. Install this resource pack test.zip
  3. Join a multiplayer server
  4. Observe the player list being colored in magenta, instead of cyan.

Expected Behavior

The player list should be colored in cyan (screenshot vanilla):
Image

Observed Behavior

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

Additional Info

This change in z-index did not occur on fabric api 0.115.1+1.21.4.

commented

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.

commented

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.

commented

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.

commented

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.

commented

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.

commented

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.

commented

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.

commented

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)

commented

Can confirm, the issue is fixed. Thank you 👍🏼

commented

Awesome, thanks for tessting. I will get this released now.