Skip to content

[Fabric 1.21.1] Hud batching makes transparent Spectrum item slot decorations cull item sprites via depth test #558

Description

@kawaiixissa13

minecraft version 1.21.1
fabric loader version 0.19.3
fabric api version 0.116.15+1.21.1
spectrum version 1.10.5
immediatelyfast version 1.6.11+1.21.1

i think its probably related to this commit 4f81ea0 but i could be wrong on that

Image

item draw call with depth test overlay:
Image

depth buffer before item draw call:

Image

depth buffer after item draw call:
Image

(the item sprite are at like depth 0.4725 and the gradient decorations are at like 0.47, u can see it eve naffects the ones that are just borders but it only hides one pixel so its harder 2 notice)

you can see that its happening with any of the items that draw a background gradient (SlotEffect.PULSE in spectrum's code), and i think its because of the depth test, it doesnt rly handle transparency very well. is it rly necessary to have the depth test on for this, it only saves like a few pixels of overdraw doesnt it? and its not on for the inventory

also it doesnt happen in the inventory, only in the hotbar
Image

i think what amkes the difference bt the 2 is that AbstractContainerScreen.render does RenderSystem.disableDepthTest(); while Gui.render does RenderSystem.enableDepthTest(); and it isnt disabled in Gui.renderItemHotbar. idk why it only happens with hud batching tho maybe its like an ordering thing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions