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

If cullface is specified for the top/bottom faces of glass panes or iron bars, more faces are culled than expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.1, 23w31a, 23w32a, 23w33a, 23w35a, 1.20.2, 23w40a, 1.20.4, 1.21
    • None
    • Community Consensus
    • Textures and models

      blocked by or blocks MC-50349

      The bug

      If cullface arguments are added to glass panes or iron bars, for example as an attempt to fix MC-50349 or MC-136264, the face culling will overcompensate and cull faces that logically should not be culled.

      For example, a single glass pane "post" placed on top of a plus shape of glass panes extending in all four compass directions will result in the tops of the four parts extending outwards being culled, rather than only the central 2x2 pixel square being culled.

      How to reproduce

      1. Download and apply the attached "overculling demo" resource pack
      2. Place arrangements of glass panes or iron bars, e.g. a solid sheet with one extra pane extending out the face
      3. Observe

      Expected results

      The top faces would only be culled if there is another glass pane on top whose shape would warrant culling.

      Actual results

      The top faces are always all culled if there is a glass pane on top without any regard for the shape of it.

      How to fix

      When cullface is applied, it should take into account the states of the block above it to check whether a face should be culled or not.

      Possible results

      The same arrangement of glass panes is shown in the following three screenshots with three differing culling behaviours.

      This is how glass panes appear in vanilla without any resource packs applied (MC-50349 is present):

      This is how glass panes appear in vanilla if we apply cullface to the top and bottom faces. Note how more top faces are culled than are desirable:

      This is how glass panes should appear in vanilla if we were to apply cullface to the top and bottom faces. Note how the top faces are culled if a pane is immediately on top of an element, and they are not culled if one is not; the geometries of adjacent pane blocks are respected. This result was achieved in Optifine 1.20.1 using a resource pack which is also attached (connected textures must be enabled for this to work).

        1. _BugTracker_ (1.21).png
          _BugTracker_ (1.21).png
          639 kB
        2. 2023-08-05_23.55.17.png
          2023-08-05_23.55.17.png
          281 kB
        3. 2023-08-05_23.56.05.png
          2023-08-05_23.56.05.png
          280 kB
        4. 2023-08-05_23.56.50.png
          2023-08-05_23.56.50.png
          285 kB
        5. 2023-12-24_22.07.16.png
          2023-12-24_22.07.16.png
          372 kB
        6. optifine-correct-culling-demo-1.20.1-v1.0.zip
          15 kB
        7. overculling-demo-1.20.1-v1.0.zip
          3 kB

            Unassigned Unassigned
            Awesoman3000 Connor Steppie
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: