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

Entity hitbox lines become thicker as the camera is moved away from the corners of the hitbox, while not facing straight forward

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21, 24w39a
    • None
    • Community Consensus
    • Camera, Hitboxes, Rendering
    • Low
    • Platform

      Originally reported as one of the bugs in MC-274032, but got invalidated because there were multiple bugs in one ticket.

      The bug:

      While the camera is moved upward from the bottom of a hitbox, downward from the top, or in general farther away from all corners, the hitbox lines (when F3 + B is enabled) start becoming thicker and thicker.

      How to reproduce:

      This works with any entity hitbox, but it is easier to notice the issue with a very tall one or a very wide one.

      • For the vertical effect:
        1. Execute the following command:
          /summon minecraft:interaction ~ ~ ~ {height:300}
        2. Press F3 + B to enable entity hitboxes.
        3. Look 45 degrees upward or downward.
        4. Start moving upward while looking at the interaction's hitbox.
          The hitbox lines start getting thicker.
      • For the horizontal effect:
        1. Execute the following command:
          /summon minecraft:interaction ~ ~ ~ {width:300}
        2. Press F3 + B to enable entity hitboxes.
        3. Go to one of the hitbox's corners.
        4. Look 45 degrees to your left or right, so that you are facing diagonally.
        5. Start moving along one horizontal edge of the interaction's hitbox while looking its lines.
          The hitbox lines start getting thicker.

      Expected result:

      The hitbox lines will stay thin as usual.

      Observed result:

      The hitbox lines start becoming thicker.

      Cause:

      Hitbox lines have two properties: they always keep the same thickness regardless of how far away from the player they are, and they are affected by the camera yaw, which means the parts of the hitbox lines that are closer to the screen are rendered thicker than the farther away ones (just like everything else in the game, since this is how 3D rendering works). When looking down at the bottom of a tall hitbox (or up at the top, or straight at one of its vertical edges) while being around the middle of it, the camera tries to simulate the same line thickness that it would render while being at the bottom or top, which is thicker than normal because the distance of the camera to the edge of the hitbox is several blocks. Each point of the hitbox line is rendered even thicker the closer it is to the camera, which means that the closer to the camera part of the already very thick hitbox line is shown even thicker.

      A potential solution to this would be to make the hitbox lines always render with the same thickness irrespective of the distance to the camera.

        1. MC-274051 (1).mp4
          6.05 MB
          [Helper] ManosSef
        2. MC-274051 (2).mp4
          5.88 MB
          [Helper] ManosSef

            Unassigned Unassigned
            ManosSef [Helper] ManosSef
            Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: