Rendered items issue (render state leak) with Item Frames
maruohon opened this issue ยท 5 comments
Yes, it's me again... :P
This time there is a rendering derp when there is an Item Frame being rendered, with an item in it, and then you hover over ItemStacks in your inventory. One of the Storage Drawers then changes to a darker item rendering.
Storage Drawers 4.2.6 on MC 1.11.2, Forge 2298.
Examples:
- No item in the Item Frame, things are fine: http://i.imgur.com/kIClxzS.png
- Item in the Item Frame, but not currently hovering over an ItemStack, still fine: http://i.imgur.com/vhEoTYn.png
- Item in the Item Frame, and hovering over a stack.. oh noes: http://i.imgur.com/34m5xZc.png (the Cobblestone turned darker)
Isn't rendering fun...
I sort of want to find an even weirder problems by putting skulls inside item frames.
The interesting behavior is only the first item in the last drawer block placed rendered without proper lighting (I'm going to assume that the last-placed block TESR renders first).
Maybe it's our fault, or maybe rescale normal gets into a weird state somewhere else, but toggling it both ways before our disable hack seems to fix it. Disable alone didn't work, so I suspect the state was opposite to what we wanted: enabled in GL state, but marked disabled in the manager.
GlStateManager.enableRescaleNormal();
GlStateManager.disableRescaleNormal();
GlStateManager.pushAttrib();
GlStateManager.enableRescaleNormal();
GlStateManager.popAttrib();
Interesting. I really should learn OpenGL properly myself at some point... just never seems to be the time for that.
For me it was the first drawer block placed that rendered funny. Without taking a closer look, I'm assuming it depends on which order the TEs come out of the chunk TileEntity map when the chunk is being rendered, so it might be world-position dependant which one renders first(?)