The bug
"3D texture" item models currently have issues when generated for some textures with translucency.
In particular, they appear to have missing side edges, as can be seen in the provided screenshot. (The texture used for this example is also provided)
Code analysis
These models are generated by the ItemModelGenerator
class. This has a function isTransparent
, which considers a pixel to be transparent if it has an alpha value of 0:
return (p_178391_1_[p_178391_3_ * p_178391_4_ + p_178391_2_] >> 24 & 255) == 0;
However, the RenderItem
class used for rendering the items uses the following for alpha testing:
GlStateManager.alphaFunc(516, 0.1F);
(516 being the value of GL11.GL_GREATER
), which means only item model parts with an alpha value > 0.1 will be rendered.
The transparency handling should be made consistent between these two places to prevent these issues.
Linked issues
Attachments
Comments 2
This issue no longer occurs in 1.15.2 and 20w21a, it renders just fine in the hand now.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
Confirmed (see
[media], which changes the poisonous potato texture). I've also attached screenshots of the effects of changing this both ways:
[media]
[media], which is changing isTransparent to use
<= 25
(255 / 10)., which is changing the alpha check in
RenderItem
(andRenderEntityItem
for dropped items) to check against 0I personally find fix 1 nicer (with super low alpha, it's hard to see the edges), but a combination of these may also make sense.
Just a side note (though you're probably already aware): if you see things like
p_178391_1_
, you can use MCPBot to set names for them.