Fence multipart model system performance optimization
The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two elements. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.
An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes MC-109478). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system which would require rewriting to work with this fix.
How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void
- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90
- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence
- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
Linked Issues
relates to15
Created Issue:
Fence multipart model system performance optimization
Closely relates to
MC-260296, MC-262427,MC-262433, MC-262452, MC-262461, MC-262470, MC-262527, MC-262641,MC-262652, MC-262689, MC-262953 and MC-267127.The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two cuboids. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.
An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes
MC-109748). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system I am yet to decipher.How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
Closely relates to
MC-260296, MC-262427,MC-262433, MC-262452, MC-262461, MC-262470, MC-262527, MC-262641,MC-262652, MC-262689, MC-262953 and MC-267127.The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two cuboids. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.
An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes
MC-109748). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system I am yet to decipher.How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
Closely relates to
MC-260296, MC-262427,MC-262433, MC-262452, MC-262461, MC-262470, MC-262527, MC-262641,MC-262652, MC-262689, MC-262953 and MC-267127.The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two cuboids. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.
An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes MC-109478). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system I am yet to decipher.
How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
relates to
relates to
Closely relates to
MC-260296, MC-262427,MC-262433, MC-262452, MC-262461, MC-262470, MC-262527, MC-262641,MC-262652, MC-262689, MC-262953 and MC-267127.The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two cuboids. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.
An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes MC-109478). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system
I am yet to decipher.How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
Closely relates to
MC-260296, MC-262427,MC-262433, MC-262452, MC-262461, MC-262470, MC-262527, MC-262641,MC-262652, MC-262689, MC-262953 and MC-267127.The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two cuboids. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.
An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes MC-109478). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system which would require rewriting to work with this fix.
How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
relates to
Closely relates to
MC-260296, MC-262427,MC-262433, MC-262452, MC-262461, MC-262470, MC-262527, MC-262641,MC-262652, MC-262689, MC-262953 and MC-267127.The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two cuboids. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.
An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes MC-109478). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system which would require rewriting to work with this fix.
How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two
cuboids. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes MC-109478). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system which would require rewriting to work with this fix.
How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
The bug
Fences are a particularly laggy block due to their often complex geometry (see also MC-123584). For fences where two opposite directions have a connection, it is possible to optimize the geometry such that the game needs to render fewer triangles for effectively the same visual result.
Currently in vanilla, fences use a multipart model consisting of a central post plus one to four outward connection pieces. These outward connections have up to ten faces each, although adjacent block culling often reduces this to eight. For fences which have both north and south connections and/or east and west connections, this adds up to 20 (often culled to 16) faces for the relevant axis. However, it's possible to reduce this to 12 (8) faces with a bit of resource pack magic.
We implement a third model file for each fence, titled [material]_fence_side_long, which defines the two bars stretching from one end of the block to the other via one cuboid per bar, rather than the standard approach which splits it into two elements. The blockstates file for each fence is edited as to not use the standard fence_side in cases where both north and south are true (or both east and west are true), and instead use this specific long side model. As such, with less faces needed for the game to render, we get a visually identical result with less rendering performance impact.
An implementation of this fix is attached in the form of a resource pack. Unless you use Spectator mode or otherwise find yourself intersecting fence blocks, there should be no visual difference from vanilla fences (aside from the fact that this resource pack fixes MC-109478). All fence types are affected by this fix with the exception of bamboo fences, as these use their own texturing system which would require rewriting to work with this fix.
How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90- Run the command
/fill -30 -63 -30 30 -56 30 oak_fence- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
relates to
relates to
Relates to: MC-260296 MC-262427 MC-262452 MC-262461 MC-262470 MC-262527 MC-262641 MC-262652 MC-262689 MC-262953 MC-267127 MC-267315 MC-267864 MC-279350
The bug
The current multipart system for walls can use more quads than are necessary to achieve an identical visual result. Making Minecraft render more quads increases render lag, so decreasing the amount needed will improve performance.
The case in question is much the same as MC-267281, arising where two opposite connections of a wall are either both "low" or both "tall". Minecraft, by default, will render one model in each direction, with a total of two. However, the exact same visual outcome can be achieved using a single, continuous model, reducing the amount of quads used for this case from 10 to 6. Since there are no texture mapping issues on walls (unlike MC-109478 and MC-225819/MC-267871), this fix also completely preserves their appearance, so we get no bonus fixes.
How to reproduce
- Create this superflat world:
minecraft:barrier;minecraft:the_void
- Initiate flying mode
/fill -30 -63 -30 30 -56 30 cobblestone_wall
/fill -30 -55 -30 30 -48 30 cobblestone_wall
/tp @s 0 0 0 0 90
- Compare framerates with and without the attached resource pack using F3+2
Expected results
Vanilla's framerates would be ideal.
Actual results
The resource pack gives better results.
How to fix
Adopt the system demonstrated by this resource pack for walls. I give Mojang full permission to use this resource pack to fix this optimization problem.
Relates to: MC-260296 MC-262427 MC-262452 MC-262461 MC-262470 MC-262527 MC-262641 MC-262652 MC-262689 MC-262953 MC-267127 MC-267281 MC-267315 MC-267864 MC-279350 MC-279354
The bug
Bamboo fences, like other fence types (see MC-267281), are not modelled in a way which is optimal for rendering performances. As a result, areas which use large amounts of bamboo fences will decrease framerate much more than otherwise should be the case.
Bamboo fences use a fundamentally different system for modelling compared to other fences, which is why I'm reporting this separately from the other fences. Tragically the issues with the normal fence model have carried over to the system used for bamboo fences.
The model system bamboo fences use is also more complicated than is neccessary - it uses four models for orthogonal connections, whereas this optimized system achieves a visually identical outcome using just three.
Note that since bamboo models use a unique texture rather than just copying the bamboo planks texture, the texture mapping will need to be shifted around. A modified version is found within the attached resource pack - the visual outcome will be identical, but existing resource packs will need to be changed by their authors to fit around it (assuming they don't take the lazy route and just copy over the old, terrible models).
How to reproduce
- Create a creative Superflat world with the following preset:
minecraft:barrier;minecraft:the_void
- Enter flying mode by double pressing the jump button
- Run the command
/tp @s 0 -20 0 0 90
- Run the command
/fill -30 -63 -30 30 -56 30 bamboo_fence
- Open the performance graphs via F3+2
- Switch between the default resources and the attached resource pack, comparing the performance
Expected results
Good framerates in vanilla.
Actual results
We can do far better.
How to fix
Simply implement the resources in the attached resource pack into vanilla. I give Mojang my full permission and encouragement to use these files to make vanilla Minecraft run better.
Further notes
Mipmapping will be affected, however this is a non-issue.
The bamboo fence item model is also updated to fit the new system.
Many of the old model files can be safely deleted once the new ones are added, as this improved system renders them completely superseded.


You linked the wrong report at the end of the "the bug" section.
Confirmed.