-
Bug
-
Resolution: Unresolved
-
None
-
1.19.4, 1.20 Pre-release 5, 1.20 Release Candidate 1, 1.20, 1.20.1, 1.20.3 Release Candidate 1
-
Community Consensus
-
Rendering, Textures and models
The bug
If a model which contains faces which are coplanar and intersect each other is enchanted, Z-fighting can be seen where they intersect, even if the textures the model uses are otherwise mapped identically such that no Z-fighting would occur between the textures themselves.
How to reproduce
- Give yourself an enchanted wall by using the command provided below.
/give @s minecraft:cobblestone_wall{Enchantments:[{}]}
- Look at it as an item from below.
Expected results
The enchantment glint would look normal on the bottom, like all other faces.
Actual results
Flickering is evident where the two constituent cuboids coincide.
How to fix
It appears that the enchantment glint will always appear the same at a given position in the texture, regardless of where the texture is used. The Z-fighting appears to occur due to the glint being applied twice at the provided position. I'm not sure how feasible it would be to compute an outer shape for each model and have the glint applied to that, as opposed to applying it directly to texture planes.
While this issue could probably be "resolved" by making the wall item model use three non-intersecting elements instead of two intersecting elements, I'd recommend against this since rendering more triangles than are needed carries with it a rendering debt. This would also not resolve the issue at all - it'd just mask it for enchanted walls and would not stop it from affecting countless custom models.
- relates to
-
MC-208949 Z-fighting occurs when an enchanted item with a two-dimensional face is held or dropped
- Open
-
MC-268537 Block cracking animation appears much darker where there are coinciding planes
- Open
-
MC-167526 Back part of the glint animation on many enchanted items shows Z-fighting
- Reopened