-
Bug
-
Resolution: Unresolved
-
None
-
1.19.4, 23w18a
-
Confirmed
-
Performance, Textures and models
-
Normal
-
Gameplay
For further optimizations, refer to MC-262433.
[ticket pending rewrite - maybe later today?]
The bug
The model for flower pots (and by extension, the models for potted objects) are notably more convoluted than they need to be. This results in two seemingly unrelated, but fundamentally linked, issues:
- Flower pots are considerably more taxing to render, and can cause render lag if many are present (see also
MC-260296) - The texture mapping on flower pots is rather unintuitive, especially on the bottom
Optimisation
The current vanilla flower pot model, as of 23w18a and 1.19.4, uses five elements/cuboids: one uses the dirt texture on the top and the outside texture on the bottom, whereas the other four represent different edges of the pot. However, across those five elements, there are a total of 22 faces, which is less than optimal: many of these faces (specifically the outsides of the pot and the bottom) are coplanar with each other, appearing to be single faces when in fact they are composed of multiple. We can do better.
The resource pack attached to this issue achieves the exact same visual result with five elements, with 14 faces rather than 22. This is a considerable reduction (both in render lag and file size), and you can feel it.
How to reproduce
- Download the attached resource pack containing the optimized flower pot models
- Create a superflat world with the following preset:
minecraft:barrier,20*minecraft:flower_pot;minecraft:the_void
- Set render distance to 2 and simulation distance to 5
- Open the FPS bars using Alt+F3
/tp @s 0 -42 0 0 90
- Compare where the FPS graph evens out with the vanilla flower pot model vs. the optimized flower pot model - the optimized flower pot will give better FPS
Texture mapping
The other major issue with the flower pot model is how the textures are applied to the block. The flower pot block texture, since their introduction in 1.4.2, has only ever had textures for the top and side - the bottom was never normally visible until 1.13, so a texture plane on the bottom was largely disregarded. In 1.16, the bug arising from this (MC-120335, MC-170842) was fixed, however the actual texture file for the flower pot remained unchanged. As a result, the bottom "texture" is effectively a random mishmash of parts of the top and side texture from different elements of the model, and isn't consistent between different potted plants either as a result (MC-194192).
This issue is a fairly easy fix - there's enough space within a 16x16 texture file to accommodate textures for individual top, side and bottom textures, although things will need to be shuffled around to fit. The attached resource pack contains a texture file for flower pots with defined top, side and bottom regions, and a Programmer Art version of this texture is also attached to this issue separately. The bottom texture has been made to visually match the current bottom "texture" perfectly in both cases.
I've tested this model thoroughly using multiple texture resolutions and can confirm it is absolutely visually identical to the model currently used in vanilla - any visual differences are either only visible by clipping inside of the pot in Spectator mode or by other means, or are a result of precision issues such as MC-246224.
Info for resource pack creators
As this new texture format will break compatibility with any previously created custom textures for flower pots, here is a brief explanation of the new format and a rough guide to how to convert existing textures to this format.
The new texture layout is composed of four 6x6 quadrants.
- The top-left 6x6 region is for the top texture of the flower pot, so move the middle 6x6 region to the top left.
- The bottom-left 6x6 region is for the side texture of the flower pot. Move the bottom-middle 6x6 region of the old texture to this quadrant. (The top row of pixels should be a duplicate of the bottom row of pixels for the top texture.)
- The top-right 6x6 region is for the inside of the flower pot. By default, this visually duplicates the outside, so you can copy that region to here.
- The bottom-right 6x6 region is for the bottom of the flower pot. Resource pack creators will probably want to create their own bottom texture, but if the previous appearance is desired it can be recreated by placing the top texture here, and filling in its central 4x4 gap with the bottom-middle 4x4 region of the side texture.
How to fix
I've done all of the hard work here to my knowledge - all that needs done is for the flower pot block texture to be replaced with the new texture from the resource pack, for all of the models (flower_pot.json, flower_pot_cross.json, potted_bamboo.json, potted_cactus.json, potted_mangrove_propagule.json, template_potted_azalea_bush.json, tinted_flower_pot_cross.json) to be replaced with the versions in the attached resource pack, and for Programmer Art's flower pot texture to also be replaced with the attached updated version of the texture.
If permission of some sort is required to have these models and textures implemented into the vanilla game, consider it granted (if this is not possible, then we can discuss this in the comments of this ticket).
Further notes
There may be other optimizations that can be made to flower pots and potted objects - I will discuss these in future tickets as to not overload this one and risk making it confusing.
- is duplicated by
-
MC-262433 Flower pots have redundant coplanar top faces, impacting performance, and extra interior faces that cannot normally be seen
- Resolved
- relates to
-
MC-262452 Hopper models are unoptimized and cause rendering lag
- Open
-
MC-262461 Stair models are unoptimized and can cause rendering lag
- Open
-
MC-262470 Cauldron models are very unoptimized, causing render lag
- Open
-
MC-262527 Item frame models are quite unoptimized
- Open
-
MC-267127 Composter model is unoptimized, causing extra rendering lag
- Open
-
MC-252693 Huge FPS drop in areas with a lot of honey blocks and slime blocks
- Resolved
-
MC-260296 Pink petal block models are not optimized
- Resolved
-
MC-262652 Dragon egg's side texture is mapped strangely as of 1.8 (and the model is also unoptimized)
- Resolved
-
MC-262641 Chorus flower models are incredibly unoptimized and cause serious rendering lag
- Open
-
MC-262689 Hanging mangrove propagule models are comically unoptimized
- Open
-
MC-262953 Fence gate models are very unoptimized, causing lag among other issues
- Open
-
MC-267281 Fence multipart model system performance optimization
- Open
-
MC-267315 Rendering performance optimization for glass pane models
- Open
-
MC-267864 Two-tall plant model/rendering not optimized
- Open