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

Some generated item models have 'missing' edges

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.15.2
    • Minecraft 1.12.2, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w48a, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w03b, Minecraft 18w06a, Minecraft 18w09a, Minecraft 18w10d, Minecraft 18w14b, Minecraft 18w20c, Minecraft 1.13-pre1, Minecraft 1.13-pre3, Minecraft 1.13-pre6, Minecraft 1.13-pre8, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 1.13.1, Minecraft 1.13.2
    • None
    • Confirmed
    • (Unassigned)

      The bug

      "3D texture" item models currently have issues when generated for some textures with translucency.
      In particular, they appear to have missing side edges, as can be seen in the provided screenshot. (The texture used for this example is also provided)

      Code analysis

      These models are generated by the ItemModelGenerator class. This has a function isTransparent, which considers a pixel to be transparent if it has an alpha value of 0:

      return (p_178391_1_[p_178391_3_ * p_178391_4_ + p_178391_2_] >> 24 & 255) == 0;
      

      However, the RenderItem class used for rendering the items uses the following for alpha testing:

      GlStateManager.alphaFunc(516, 0.1F);
      

      (516 being the value of GL11.GL_GREATER), which means only item model parts with an alpha value > 0.1 will be rendered.

      The transparency handling should be made consistent between these two places to prevent these issues.

        1. 2017-11-01_22.59.22.png
          2017-11-01_22.59.22.png
          146 kB
        2. opacity_test.png
          opacity_test.png
          0.2 kB
        3. fix2_2017-11-01_17.15.24.png
          fix2_2017-11-01_17.15.24.png
          197 kB
        4. fix1_2017-11-01_17.06.46.png
          fix1_2017-11-01_17.06.46.png
          193 kB
        5. MC-121516.zip
          1 kB

            Unassigned Unassigned
            quadraxis Ben Staddon
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: