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

On some operating systems, atlases can contain garbage data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 24w37a
    • None
    • Plausible
    • (Unassigned)

      The bug

      On certain operating systems and certain hardware, the "unused" regions of texture atlases can be filled with graphical data from elsewhere.

      This is an issue due to in introducing unwanted nondeterminism when saving atlas files for analysis (see also MC-269347), and the fact that keeping this information in memory will also eat up extra video RAM for no benefit (see also MC-263119).

      This happens on my computer with Linux (Kubuntu 24.04). Windows 11 on the same machine does not exhibit this issue.

      How to fix

      When generating a new atlas, fill the entire field with a single texture. I've opted for a green-and-black checkerboard, similar to the missing texture; if this ends up being displayed in-game, we can narrow down the issue to UVs pulling from an incorrect region of the atlas.

      Once the image has been completely tiled over, we then add each texture to it, overwriting the checkered texture we wrote to it earlier (including transparency).

      This way, any garbage data that may have persisted from earlier iterations is completely overwritten by the new checkered texture.

      Further notes

      A screenshot with F3 open is included, which should contain machine specifications. Do tell if further information is required.

        1. 2024-09-16_21.51.26.png
          2024-09-16_21.51.26.png
          221 kB
        2. FIXED-blocksatlas.png
          FIXED-blocksatlas.png
          521 kB
        3. LINUX-blocksatlas.png
          LINUX-blocksatlas.png
          741 kB
        4. WINDOWS-blocksatlas.png
          WINDOWS-blocksatlas.png
          588 kB

            Unassigned Unassigned
            muzikbike Connor Steppie
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: