Ehhthan / HappyHud-Issues

Issue tracker for the spigot plugin HappyHud.
0 stars 0 forks source link

1.20.6 Fails to Load Resource Pack due to HH Shaders #103

Open BenguMC opened 3 months ago

BenguMC commented 3 months ago

Title. The 1.20.6 update breaks the custom shader work from HH. Needs updated. I tried some things, could not sort it out.

repeater64 commented 2 months ago

(Minor comment: It was the 1.20.5 update that broke this, not 1.20.6)

I really needed this fixed, so dived into the issue and found how to fix it (happy I managed to figure it out given that I know nothing about shaders or glsl)

All you need to do is change line 36 in the vertex shader from:

vertexDistance = fog_distance(ModelViewMat, IViewRotMat * Position, FogShape);

to

vertexDistance = fog_distance(Position, FogShape);

(I deduced this from the comment hidden deep in the 1.20.5 changelog that says "The IViewRotMat uniform has been removed, and the Position attribute for entities is now in (camera relative) world space")

(Probably the IViewRotMat uniform should be removed from this shader as well then, ie remove it from the json file and remove the uniform mat3 IViewRotMat line but seemingly it still being there doesn't cause any issues so I just did the minimum necessary to fix the issue, because I don't even know what a uniform is and didn't want to touch more than I needed to)

Presumably this will get updated when HappyHUD officially supports versions past 1.20.4, but for people using ViaVersion to allow newer clients to connect who need this fix ASAP, then this solution should work for you. (The file to change this line in would be plugins/HappyHUD/pack/minecraft/shaders/core/rendertype_text.vsh)

Hopefully this reply might save @Ehhthan a few minutes of headdache when updating as well.

repeater64 commented 2 months ago

BTW if anyone reading this is in the same situation as me - running a 1.20.4 server but allowing newer clients to join, you'll have the issue that if you fix the shader for 1.20.5+, it will be broken for people on 1.20.4.

Luckily in 1.20.2 Mojang added the ability to have some files in a resource pack only activate (or override other files) on certain versions.

You'll want to make your pack.mcmeta look like this:

   "pack":{
      "pack_format":22,
      "supported_formats":[
         22,
         100
      ],
      "description":"your resource pack description"
   },
   "overlays":{
      "entries":[
         {
            "directory":"newShadersPost1_20_4",
            "formats":[
               23,
               100
            ]
         }
      ]
   }
}

( I used version 100 so I don't have to remember to change it when future updates are released)

Then you'll need to make a folder in the root directory of your resource pack called "newShadersPost1_20_4" and inside that, create the "assets/minecraft/shaders/core" folder structure, and put the 1.20.5+ version of the .vsh file in there.

Then leave the .vsh file in the normal resource pack folder structure in the old 1.20.4 version.

S2GN commented 2 months ago

Ditto

CROSS POST LINK to same issue posted on Model Engine 4 GitHub: https://git.lumine.io/mythiccraft/model-engine-4/-/issues/128

WarnDa commented 1 month ago

Hey,

Found how to do this, edit the pack.mcmeta there : /plugins/ItemsAdder/contents/_iainternal/resourcepack

Worked for me, the pack.mcmeta is the good one in the .zip image

BUT now I don't know how to automatically add the second folder to the pack (with the 1.20.6 textures)... I could only do it manually :(

XXX10Tacles commented 5 days ago

BTW if anyone reading this is in the same situation as me - running a 1.20.4 server but allowing newer clients to join, you'll have the issue that if you fix the shader for 1.20.5+, it will be broken for people on 1.20.4.

Luckily in 1.20.2 Mojang added the ability to have some files in a resource pack only activate (or override other files) on certain versions.

You'll want to make your pack.mcmeta look like this:

   "pack":{
      "pack_format":22,
      "supported_formats":[
         22,
         100
      ],
      "description":"your resource pack description"
   },
   "overlays":{
      "entries":[
         {
            "directory":"newShadersPost1_20_4",
            "formats":[
               23,
               100
            ]
         }
      ]
   }
}

( I used version 100 so I don't have to remember to change it when future updates are released)

Then you'll need to make a folder in the root directory of your resource pack called "newShadersPost1_20_4" and inside that, create the "assets/minecraft/shaders/core" folder structure, and put the 1.20.5+ version of the .vsh file in there.

Then leave the .vsh file in the normal resource pack folder structure in the old 1.20.4 version.

This helped me well as resource pack breaks only on newer versions but for me that "vertexDistance = fog_distance(Position, FogShape);" didn't solve the problem. It still fails to reload on 1.20.6. womp womp....