Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-279350

Leaf litter multipart model system is unoptimized, causing render lag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 25w02a
    • Community Consensus
    • Performance, Rendering

      The bug

      The way in which leaf litter blockstates is wasteful; more planes are used than are actually needed to achieve said visual result.

      The current system works as follows: each of the four segments is its own model. For only one piece of leaf litter in a block, this is already optimal, however this becomes wasteful when we increase the amount:

      • two pieces of leaf litter can easily be done using an 8x16 pixel flat plane rather than two 8x8 planes. This brings the number of faces from 4 to 2.
      • three pieces can be done with the aforementioned 8x16 plane alongside the currently used 8x8 plane, rather than three 8x8 planes. This brings the number of faces from 6 to 4.
      • four pieces can be very easily done using just one flat plane covering the entire block face. This brings the number of faces from 8 to 2.

      As leaf litter is very common in forested biomes, we should be aiming to reduce its rendering performance impact.

      How to reproduce

      As MC-118624 still remains unfixed, we will need to set up our test environment manually.

      1. Create this superflat world:
        minecraft:grass_block;minecraft:the_void
      2. Run these commands:
        /fill -90 -63 -90 90 -63 90 minecraft:leaf_litter[segment_amount=4]

        ,

        /fill -90 -62 -90 90 -62 90 minecraft:grass_block

        ,

        /fill -90 -61 -90 90 -61 90 minecraft:leaf_litter[segment_amount=4]

        ,

        /fill -90 -60 -90 90 -60 90 minecraft:grass_block

        ,

        /fill -90 -59 -90 90 -59 90 minecraft:leaf_litter[segment_amount=4]

        ,

        /fill -90 -58 -90 90 -58 90 minecraft:grass_block

        ,

        /fill -90 -57 -90 90 -57 90 minecraft:leaf_litter[segment_amount=4]

        ,

        /fill -90 -56 -90 90 -56 90 minecraft:grass_block

        ,

        /fill -90 -55 -90 90 -55 90 minecraft:leaf_litter[segment_amount=4]
      3. Enter flying mode and run the command
        /tp @s 0 100 0 0 90
      4. Compare framerates with and without the attached resource pack using F3+2

      Expected results

      Ideal framerates in vanilla.

      Actual results

      The resource pack demonstrates that there is indeed room for improvement.

      How to fix

      Use this system for leaf litter models, rather than vanilla's current approach. I give Mojang full permission to use and implement the attached assets.

      Further notes

      I have considerably upgraded my PC setup since the last model optimization report, so you'll be seeing less of a performance boost in the attached screenshots compared to previously, but there is definitely an improvement.

            Unassigned Unassigned
            Awesoman3000 Connor Steppie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: