-
Bug
-
Resolution: Fixed
-
1.20.4, 24w10a
-
None
-
Community Consensus
-
Performance, Resource Packs
The bug
If the nine_slice scaling option is used with a sufficiently small texture file, we will end up encountering absurd levels of lag by virtue of the fact that small groups of pixels (or even one pixel in the most extreme case) will be rendered up to thousands and thousands of times per frame.
MC-268902 will make this issue harder to see as of the 1.20.5 snapshots, so I've included the demo of a particularly extreme case.
How to reproduce
- Download and apply the attached resource pack
- Try your best to navigate the menus using the mouse
- Optionally, open the FPS screen to compare how the game runs in the game menu versus out of it
Expected results
Good framerates.
Actual results
We will be very lag.
How to fix
For this specific case (solid-color edges and center), an option could be added to the mcmeta files to determine whether the center slice and four edge slices should be scaled via tiling or via stretching. We'd default to tiling for backwards compatibility, but stretching would remain an option. With stretching selected as the nine-slice scaling sub-option, we'd only need to render a fixed number of subregions (nine) per element, rather than however many are needed for a complete tiling.