mojira.dev
MC-276667

Item models with two or more texture layers have extra internal planes

The bug

If an item uses two textures combined together for its appearence, those two layers will be rendered in full, not accounting for cases where some geometry would never be visible from outside. This results in extra faces being rendered for no reason, causing potential render lag.

Potions, leather armor, spawn eggs, firework stars, trimmed armor and used maps are affected; in the case of trimmed armor and maps this causes extra internal Z-fighting.

How to reproduce

  1. Obtain one of these items

  2. Drop it on the ground or (excluding maps) put it in an item frame

  3. Clip inside of the item model

Expected results

Where one layer meets another, there would be no extra planes inside.

Actual results

There are.

How to fix

For the specific case of potions available in Survival, it may be worth abandoning the "base and inner with tint" system, and instead giving each potion its own texture file without a tint, meaning only one texture file needs to be rendered for each potion. This may happen in future: https://twitter.com/kingbdogz/status/1631006850282934289

However, if custom potions still exist, the two-layer system will probably be kept, and the issue will be localized to there. It will not be a Survival problem, but another solution may be required here.

Attachments

Comments 2

This also causes a LOT of z-fighting issues.

[media][media][media]

muzikbike

(Unassigned)

Confirmed

Textures and models

1.21.1, 24w37a

Retrieved