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

Hanging mangrove propagule models are comically unoptimized

XMLWordPrintable

    • Confirmed
    • Performance, Textures and models
    • Normal
    • Gameplay

      The bug

      The specifications for hanging propagules are several times larger than they need to be.

      Many of the model elements of hanging propagules are flat planes, meaning that only two sides of said elements are ever visible (e.g. top and bottom). However, the model files define faces for all six sides of these planes as if they were full cuboids, despite the fact that due to being planes, four of these "sides" have zero area and are mathematically impossible to see. Despite being invisible in practice, the game tries to render these anyway, causing a bunch of render lag we really don't need (and may be in part responsible for MC-250246).

      If we modify the propagule models to delete these unwanted faces, we can see a noticeable uptick in framerate in regions containing large amounts of mangrove propagules, while not changing how they look in the slightest.

      As it is in vanilla, hanging mangrove propagules of ages 2, 3 and 4 are the most complex block models in the game, beating even vanilla cauldrons. We can more than half the amount of faces that every type of propagule needs, though, without changing anything visual about them at all. To be specific:

      • Age 0 propagules use 42 faces, but only need 18
      • Age 1 propagules use 48 faces, but only need 22
      • Age 2, 3 and 4 propagules use 60 faces (two more than the cauldron at 58 - see MC-262470), but only need 26

      I believe MC-260296 was the exact same issue as this (zero-width faces), but with pink petals, and was fixed promptly while this still remains an issue.

      How to reproduce

      (Note: Due to MC-118624, we cannot create a superflat world to demonstrate this issue like with other optimization tickets I've made.)

      1. Download the attached resource pack
      2. Go to a region of your creative world you don't care about (you can use a default superflat world for this to cut out any unwanted FPS lag sources)
      3. Execute this command:
        /fill ~-50 ~1 ~-50 ~50 ~1 ~50 minecraft:mangrove_leaves[persistent=true]
      4. Repeat the command, replacing both cases of "~1" with "~3", "~5", ... up to some odd number you're happy with
      5. Without moving, now execute the following command:
        /fill ~-50 ~0 ~-50 ~50 ~0 ~50 minecraft:mangrove_propagule[age=4,hanging=true]
      6. Repeat this command as well, replacing both "~0" instances with even numbers until you're one lower than the odd number you previously stopped at
      7. Use Spectator mode to fly out of this mess, then go to one of the corners of this infernal mangrove lasagna you've created and switch back to Creative mode
      8. Point the player camera at this preposterous pile of propagule plywood
      9. Set your render distance to 4 chunks
      10. Open the FPS meter by using F3+2
      11. Observe how it performs with the vanilla resources versus with the attached propagule fix resource pack

      Expected results

      Acceptable framerates.

      Actual results

      A client lagfest.

      How to fix

      This should be a very easy fix. The resource pack attached contains complete fixes for all five affected mangrove propagule models, so it should be as easy as just replacing the five vanilla hanging propagule models with those in the resource pack. I've also deleted some redundant lines from the model files which rotate elements by 0 degrees, which is identical to doing nothing.

      As I've said many times before (do I even need to say this anyway?), Mojang have my full permission to use all of these model files to fix this issue, and are strongly encouraged to do so. Everyone wants the game to perform better, and this is just one way we can make that happen.

            Unassigned Unassigned
            Awesoman3000 Connor Steppie
            Votes:
            20 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              CHK: