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

Projectile yaw rotations have incorrect interpolation, causing flickering

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w33a
    • 1.20.4
    • None
    • Confirmed
    • Rendering
    • Normal
    • Platform

      There exists an issue in the rendering systems for multiple projectile entities within Minecraft 1.20.4 (existing as far back as 1.8.9), where an incorrect linear interpolation ('lerping') approach is used for updating projectile yaw rotations. This causes a visually jarring effect, where instead of smoothly transitioning between two nearly identical angles across the -180 to 179 degree boundary, projectiles undergo an unnecessarily long rotation.

      The affected projectiles; arrows, llama spit, and thrown tridents are rendered with an updating yaw angle to reflect their current direction of travel. When the angle crosses the northern discontinuity boundary between -180 degrees and 179 degrees, the current rendering logic fails to account for the shortest path between these angles. Instead of the one-degree adjustment, the projectile's rotation is interpolated across the full range of the circle in the opposite direction, following something similar to these sequences:

      -180 > -135 > -90 > -45 > 0 > 45 > 90 > 135 > 179
      -180 < -135 < -90 < -45 < 0 < 45 < 90 < 135 < 179

      This leads to the projectile visibly spinning almost a full 360 degrees unnecessarily, rather than flipping a single degree across the boundary. The resultant rotational flickering greatly reduces the visual fidelity of the game and disrupts the player's immersive experience.

      Expected Behavior & Existing Instances of Correct Implementation:

      When updating the yaw of a projectile, the renderer should utilize a degree wrapping method to ensure that the shortest rotational path is chosen. This method ensures the projectile's yaw change appears natural and smooth to the observer.

      Notably, the Wither Skull entity renderer appears to utilize a correctly functioning interpolation method. Given that the correct method already exists within the game's codebase, it should be quite easy to eliminate this bug by simply integrating it into the affected projectiles.

        1. BuggedProj.mov
          3.97 MB
        2. FixedProj.mov
          3.85 MB

            Unassigned Unassigned
            reborn_team_ reborn_team_
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: