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

Shader Normal values on block/item models are inaccurate on rotated faces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 21w11a, 21w14a, 21w20a, 1.17.1, 21w37a, 1.18.1, 22w06a, 1.19.3, 23w07a, 1.20.4
    • None
    • Confirmed
    • Textures and models
    • Normal
    • Platform

      The value of Normal in core shaders such as rendertype_solid does not match the direction of the face normal on rotated faces in block and item models (such as at 22.5 and 45 degrees). Instead, the direction of the Normal vector points as if the face was not rotated. This happens for anywhere block and item models are present, such as held in the hand, displayed as an item on entity or item frame, in the inventory etc.  Possibly intentional and/or a result of vanilla disregarding rotation for lighting.

       

      To reproduce in positive y direction including on items and in inventory (ShaderNormalsBugFull.zip):

      1. Download the ShaderNormalsBugFull.zip resource pack. This will highlight everything with the following condition (upwards direction on blocks).

      Normal == vec3(0.0,1.0,0.0)

      In the GUI it will highlight everything with the following condition (top face direction on blocks).

      Normal == vec3(0.0, 109.0/127.0, 63.0/127.0) 

      2. Place lecterns to see that in the positive y direction they get highlighted red along with the positive y face on normal blocks, indicating that their normal value is in the positive y direction as well.

      3. Summon an armor stand with a lectern on it

      /summon minecraft:armor_stand ~ ~ ~ {ArmorItems:[{},{},{},{id:"lectern",Count:1b}]} 

      4. Hold a lectern and also place a lectern in an item frame

      5. Teleport yourself to align correctly with entities

      /tp @s ~ ~ ~ 180 0

      6. Notice that in all these places, including in your hand and in your inventory UI, the top face of the lectern is highlighted red even though it does not point straight up, indicating that its normal value is unchanged from a non-rotated block face.

       

       

      (Old alternate test with previous resource pack)

      To reproduce in positive x direction (ShaderNormalsBug.zip):

      1. Download the ShaderNormalsBug.zip resource pack. This will highlight everything with the following condition (positive x direction on blocks).

      Normal == vec3(1.0,0.0,0.0)

      2. Place blocks such as slanted rails, torches, and lecterns in the positive x direction to see that they get highlighted red along with the positive x face on normal blocks, indicating that their normal value is in the positive x direction.

        1. screenshot-1.png
          screenshot-1.png
          687 kB
        2. screenshot-2.png
          screenshot-2.png
          300 kB
        3. ShaderNormalsBug.zip
          3 kB
        4. ShaderNormalsBugFull.zip
          47 kB

            Unassigned Unassigned
            onnowhere Onnowhere
            Votes:
            18 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              CHK: