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

Ender Dragon Death Animation can cause Lightning to render incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.4, 24w11a
    • None
    • OS: Windows 10
      Java: 17.0.8 64bit
      Graphics Card: NVIDIA GeForce GTX 1660 Ti
    • Community Consensus
    • Lighting, Rendering

      During the Ender Dragon's death animation, Lightning Bolts will sometimes render incorrectly.

      What I expected to happen was...:

      Lightning should render as normal, ie. be made of nicely connected quads.

      What actually happened was...:

      Lightning renders incorrectly.

      See attached screenshot deformed_lightning_example.png for an example.

      The base of the Lightning Bolt shows corners instead of smooth edges, and there are thin vertical lines on the border of the bolt.

      Steps to Reproduce:

      Look at a Lightning Bolt during the Ender Dragon's death animation.

      The bug occurs on Fast, Fancy and Fabulous graphics

      For ease of reproduction:
      1. Create new world in Creative Mode

      2. Go to The End, kill the Ender Dragon

      3. Setup a basic Redstone clock close to the portal, activating a Command Block with the command "/summon minecraft:lightning_bolt ~ ~5 ~"

      4. Summon the Ender Dragon. For ease of repeated testing use "/summon minecraft:ender_dragon 0 80 0 {Health:1}"

      5. Kill the Ender Dragon

      6. Look at the summoned Lightning Bolts as the Dragon dies. They will sometimes render incorrectly.

      (Note that with this method the bug is somewhat inconsistent, and seems to happen roughly half the time. If this doesn't seem to work, you may have to repeat a few times.)

      See the attached video video_example.mp4 for an example.

      Code Analysis

      (From Minecraft Java 1.20.4)

      During the Ender Dragon's death animation, it emits between 0 and 60 purple beams, where the number of beams depends on the progress of the animation.

      Each beam is constructed from 9 vertices, arranged in (what I assume is meant to be) 3 triangles each.

      However, the beams use the same buffer as lightning bolts, which is meant to accept quads, not triangles.

      This means that, when the number of beams is not divisible by 4, there will be leftover vertices.

      These leftover vertices are presumably what disrupts the lightning rendering, causing it to draw quads using the wrong vertices and resulting in the jagged edges.

      Note: Whilst this bug seems to lack any obvious effect on the dragon's death animation itself, it may be partially responsible for some odd transparency issues, where there are sometimes darker triangles visible within the glow. See the attached screenshot dragon_death_transparency_example.png for an example.

            Unassigned Unassigned
            Phanastrae Phanastrae
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: