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

Shader texture coordinate wrapping mode causes screen effects like glowing to wrap where they shouldn't



    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 21w11a
    • 21w13a
    • None
    • Confirmed
    • Rendering
    • Important


      Certain shaders seem to access buffers with a texture coordinate wrapping mode that causes the result to wrap where it sometimes isn't intended, such that accessing a buffer at position (1,1) returns the color at (0,0). This currently happens even to new custom buffers. This did not happen in 1.16.

      This can easily be seen in the default vanilla shaders by applying glowing effect to an entity and then moving the entity to an edge the screen and seeing the glowing effect wrap to the other side of the screen.

      To Reproduce:

      1. Summon a glowing entity

       /summon minecraft:armor_stand ~ ~ ~ {Glowing:1b}

      2. Move the armor stand to the edge of the screen and observe a thin line appearing on the opposite edge where the glowing effect wraps around.


      To Reproduce in a custom shader:

      1. Apply the downloaded resource pack and set graphics to Fabulous!
      2. Notice the screen is blue. The texture being displayed (textures/effect/image) has blue in the bottom left corner, and so accessing vec2(1.0) wraps around and gets the color at vec2(0.0). Compare to 1.16 to see that the resource pack displays green instead (no wrapping)
      3. Optionally uncomment the last line in shaders/program/wrapmodeshaderbug.fsh and see that it will now display green from accessing vec2(0.9) instead.




            xilefian [Mojang] Felix Jones
            onnowhere Onnowhere
            2 Vote for this issue
            4 Start watching this issue