-
Bug
-
Resolution: Unresolved
-
None
-
1.19.4, 1.20 Pre-release 6
-
Confirmed
-
Performance, Textures and models
The bug
The four template models used for fence gates specify more texture planes than are needed, causing the game to render far more triangles in areas which contain a large amount of fence gates, resulting in extra lag. To be specific:
- template_fence_gate.json and template_fence_gate_wall.json specify 40 planes, but only need to specify 24
- template_fence_gate_open.json and template_fence_gate_wall_open.json specify 40 planes, but only need to specify 36
Unlike most other model optimization tickets (but like MC-262652), such an optimized model does not look outwardly perfectly identical to the current vanilla fence gate. This is due to vanilla's fence gates being affected by MC-262935 and MC-262936, which are undesirable texture mapping bugs. The optimized fence gate models do away with these issues entirely in favor of a more intuitively mapped gate model.
How to reproduce
- Download the attached "complete fix" resource pack
- Create a superflat world with this preset:
minecraft:bedrock,20*minecraft:oak_fence_gate;minecraft:the_void
- Set the render distance to 2 chunks
- Enter Spectator mode
- Run the command
/tp @s 0 -40 0 0 90
- Use Alt+F3 to view the FPS bar
- Compare the performance with the vanilla resources versus the optimized fence gates
The optimized fence gate resource pack should offer a considerable performance benefit over vanilla (and should therefore be what vanilla uses in the first place).
How to fix
This should be a very, very easy fix. Just take the four template models inside of the attached resource pack (template_fence_gate.json, template_fence_gate_open.json, template_fence_gate_wall.json, template_fence_gate_wall_open.json) and replace the vanilla model files with them, and fence gates should now have a markedly lower performance impact (and a slightly lower file size as well).
These models also fix some other existing issues plaguing fence gates:
- The textures used on parts of the constituent doors should now rotate in an intuitive manner when opened. (
MC-92182, whose closing was probably a misunderstanding of the issue) - Two faces inside of fence gates that can never be seen without clipping inside of them have been deleted, and cullface has been added for the two top squares for non-wall fence gates. (MC-238734)
- Both sides of the fence gate are now mapped in a way that preserves the block's texture - in vanilla, it's randomly and weirdly cut off in places for no good reason. (MC-262935)
- Some stretched pixels on open fence gates have been fixed as part of the intuitive rotation mapping. (MC-262936)
A second separate resource pack is attached which disables uvlock on fence gates, as its presence interferes with the rotation of textures between open/closed states.
Further notes
I haven't touched bamboo fence gates at all since they have a custom texture which requires specific mapping, rather than reusing the constituent planks. To make this fix work for bamboo fence gates would require fundamentally rearranging this texture file.
- relates to
-
MC-262427 Flower pots and potted objects have very poorly optimized models and strange texture mapping
- Open
-
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-262641 Chorus flower models are incredibly unoptimized and cause serious rendering lag
- Open
-
MC-262689 Hanging mangrove propagule models are comically unoptimized
- Open
-
MC-267127 Composter model is unoptimized, causing extra rendering lag
- Open
-
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-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