Skip to content

[BUG] Item slot decorations draw OVER hotbar items when ImmediatelyFast has hud batching enabled #932

Description

@kawaiixissa13

Describe the bug
with hud batching on in immediatelyfast, item decorations are drawn over items even when transparent which means the depth stencil ends up blocking it

To Reproduce

  1. have an item with the SlotEffect.PULSE decoration
  2. look at it in the hotbar with ImmediatelyFast hud batching enabled (on by default w/ the mod)

Expected behavior
draws normally

Version information
Spectrum Version: 1.10.5
Minecraft Version: 1.21.1
Mod Loader: Fabric

Screenshots

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

i also made RaphiMC/ImmediatelyFast#558 since it might be an issue on their end

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