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

The game generates unusable depth textures for post render targets

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 24w37a
    • None
    • Windows
    • Unconfirmed
    • (Unassigned)

      Each internal render target created by the game for post chains has a depth texture, but depth testing is disabled before these shaders get executed, making them unusable.

      In previous versions (1.20.1 and before) depth testing wasn't disabled, so writing to depth textures was possible. Attached is a resource pack that tries to write 0.5 to the depth texture with gl_FragDepth and then displays the contents of it to the screen, getting 1.0.

      Steps to Reproduce:

      1. Attach render-doc to the game (for simplicity)
      2. Load in the resource pack attached to the issue and create a frame capture
      3. Find the draw call that renders the "test.json" pass from the resource pack (it renders a magenta image, which should be easily visible in the texture viewer)
        → For me this is right before a debug name called "Color Pass #4"
      4. Check the frame-buffer (FB) on the pipeline state page.-

      Observed Results:

      As seen on the image below, the frame-buffer has two attachments, a color texture and a depth texture.

      But checking the depth state below this point shows that writing to it is disabled

      Expected Results:

      Either keep the original (pre 1.21.2) functionality and enable depth testing to let post shaders write to the depth buffer or disable depth buffer creation for these targets, as they are redundant.

        1. image-2024-09-19-00-59-17-590.png
          17 kB
          BalintCsala
        2. image-2024-09-19-00-59-46-221.png
          4 kB
          BalintCsala

            Unassigned Unassigned
            BalintCsala BalintCsala
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: