
Better translucency sorting for translucent inventory items
muzikbike opened this issue ยท 1 comments
Request Description
Translucency sorting for world geometry is in a much better state than vanilla right now (with more to come with the fix for #2943), however other things like entities and particles are still not in a good state. These, however, are not a priority.
One thing that could be focused on, however, is items displayed in inventory screens, as well as in the player's hands in first person view, since they aren't "part of the world" in the traditional sense, and issues can be seen here (https://bugs.mojang.com/browse/MC-280002).
Attached is a resource pack with a translucent cross model. This exhibits a sorting bug which is already fixed in a development build (https://discord.com/channels/602796788608401408/1331408629311733790/1334283078490783774).
In the inventory, red stained glass will look incorrect - each half will be a different "brightness" than the other, where consistency would be expected.
When held in the hand, a distracting flickering effect can be seen as each plane fights for which should be rendered on top.
The fix should be around as easy as #2943's - translucent item models need to have these planes split accordingly so that there isn't any fighting happening or incorrect occlusion. However, this should only happen if there are actually translucent pixels in the item models, since most items use the translucent render type anyway. A material downgrading system for items may be advisable for those which only consist of full-opacity or fully-transparent pixels to avoid pointlessly creating extra geometry on other items.
The fix should be around as easy as #2943....
No, really, it wouldn't be. The item rendering pipeline in Minecraft is a disorganized mess and we don't have complete ownership of it, unlike the terrain renderer. It also has many different shaders and incompatible vertex formats, which makes it difficult to write a single general path. This would only get worse when you consider block entities with intersecting geometry.
After talking about it with Douira, we both think the amount of work involved is far too much, and won't be solving this. The best thing that resource pack authors can do is simply generate (expensive) item models without overlapping geometry, and let Minecraft try to sort it. We only need automatic handling in terrain rendering because it's common to see dynamic models, i.e. waterlogged glass panes.