Fix Z-fighting on enchanted models with coplanar intersecting faces
muzikbike opened this issue ยท 3 comments
Request Description
This issue (https://bugs.mojang.com/browse/MC-262933) is much the same as #2454, and I assume could be fixed in a similar way - compute some outer shape for the model and apply the enchantment glint to that, rather than just throwing it on the textures directly.
The easiest way to reproduce this without a resource pack is to enchant a wall, then observe it from below - despite the texture being mapped identically in the area of intersection, Z-fighting arises nonetheless.
Minecraft uses a VertexConsumer proxy to generate new geometry for the glint overlay, and it does this at render time so we don't have any opportunity to bake. It would probably be to slow/error prone to try and de-duplicate geometry as well. The only solution in my mind is to stop generating geometry and apply the effect directly in the shader, which the game doesn't do already for some reason.
Closing in favor of #2497 since the issues you have reported about enchantment glint are fundamentally the same problem.