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

Specifying the size of a target in post effect shaders fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w36a
    • 24w33a, 24w34a
    • None
    • Confirmed
    • Rendering, Resource Packs
    • Important
    • Platform

      As of 24w33a, the "targets" field of post shaders is an object, instead of an array of objects/strings. It works correctly when the name of the target is mapped to an empty object. However having the object contain fields "width" and "height" fails to load the shader file.

      Steps to Reproduce:

      1. Create a resource pack in version 24w34a (pack format 36)
      2. Copy the vanilla file assets/minecraft/post_effect/transparency.json
      3. In the "targets" field, write
        {
                "final": {},
                "potato": {
                    "width": 16, "height": 16
                }
        }
      4. Load the resource pack with fabulous graphics

      Observed Results:
      The resource pack fails loading, and the game logs raise this error:

      Failed to parse post chain at minecraft:post_effect/transparency.json
      com.google.gson.JsonSyntaxException: Both alternatives read successfully, can not pick the correct one; first: (Left[b[]], {"width":16,"height":16}) second: (Right[a[width=16, height=16]], {"width":16,"height":16}) missed input: {"potato":{"width":16,"height":16}}
      	at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287)
      	at ghx.b(SourceFile:145)
      	at ghx.a(SourceFile:80)
      	at ghx.b(SourceFile:36)
      	at auz.a(SourceFile:11)
      	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
      	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
      	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
      	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
      	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
      	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
      	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

      Expected Results:
      Since this is the vanilla file, in which we specified an unused target (the same as the example from the article, the game should not output an error.

      Notes:
      From what I understood reading the output logs, it seems the json interpreter struggles with the new syntax...

      Attachment
      The joined zip file is a resource packs, for 24w34a.It modifies the

      assets/minecraft/post_effect/transparency.json

      , specifically adding a target in the post effect shader. I made sure to use the same syntax as in the snapshot article to demonstrate the bug.

        1. deobf_latest.log
          18 kB
          [Bot] Arisa
        2. latest.log
          15 kB
          [Mod] Jarl-Penguin

            gegy1000 [Mojang] Gegy
            JulienStudio JulienStudio
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: