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

Beds are far more expensive to render than most other blocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 24w38a
    • None
    • Community Consensus
    • Performance

      The bug

      Beds are considerably more resource-intensive to render compared to other blocks in the game, even those with more complex models. This is due to a multitude of factors:

      • Beds still unnecessarily utilise block entities, which were previously used for distinguishing color prior to 1.13 but are no longer required due to separate alphanumeric IDs after this point. (MC-122532)
      • Each whole bed renders six planes that are never visible in normal gameplay. Two of these correspond to the interior of the bed, across the edge of a block (MC-167243), whereas the other four correspond to the top faces of each of the four feet of the bed.
      • When a bed is adjacent to a block of the exact same type, the occluded faces are still rendered, rather than culled as is done with most other correctly-modelled blocks. (MC-141306)

      The negative effects of this can be felt quite easily in areas with large numbers of beds, such as villager breeding stations and large iron farms.

      How to reproduce

      Attached to this ticket is a zip file containing two worlds. A resource pack is also attached which creates equivalent bed models: copper grates are remodeled to the foot of a bed, and oxidised copper grates to the head of a bed. An item model for beds also replaces the cobweb item model.

      1. Download and apply the attached resource pack
      2. Set your render distance to 2 and FOV to default, and turn off VSync
      3. Open the "bed platform" world
      4. Use F3+2 to open performance graphs
      5. /tp @s 8.5 -60 8.5 180 -22.5
      6. Observe
      7. Exit this world and repeat for the improved platform world, observing

      Expected results

      Beds would not hurt performance.

      Actual results

      They noticeably do.

      How to fix

      Should be simple enough: get rid of the block entities for beds and convert them back over to proper block models. Performance should increase considerably.

      This would also permit resource pack creators to customize bed models once again, and would fix issues such as MC-69683 and MC-231102 for beds.

        1. 2024-09-19_23.04.33.png
          169 kB
          Connor Steppie
        2. 2024-09-19_23.04.51.png
          159 kB
          Connor Steppie
        3. image-2024-09-20-01-27-03-134.png
          1.77 MB
          BugTracker

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

              Created:
              Updated:
              Resolved:
              CHK: