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: Invalid
    • None
    • 24w37a
    • None
    • Windows
    • Plausible
    • Performance, Rendering, Resource Packs

      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.

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

              Created:
              Updated:
              Resolved:
              CHK: