sp614x / optifine

1.81k stars 416 forks source link

[Bug] Minified vanilla shaders not working #7258

Open MrKinau opened 1 year ago

MrKinau commented 1 year ago

Description of Issue

Vanilla minecraft shaders stop working/getting destroyed when they are minified and there is an OptiFine lightmap in use (in the same or another Resourcepack). This happens when the texelFetch function in the vertex shader file does not have spaces between the parameters. Vanilla Minecraft can interpret it just fine, it's valid, but with OptiFine installed and a lightmap in a ResourcePack the shader breaks. Tested in 1.19.2, because the current 1.19.3 seems to be completely broken: https://github.com/sp614x/optifine/issues/7244

Steps to Reproduce

  1. Add the testrp.zip to your ResourcePacks (1.19.2)
  2. Enable the ResourcePack and join a world
  3. See that every text is broken (e.g. open ESC menu), because of the rendertype_text shader, which isn't working

OptiFine Version

OptiFine HD U I1

Installation Method

standalone

Log Files/Crash Reports

Nothing relevant to see

Prior Testing

After adding spaces between the texelFetch parameters the resourcepack works (see testrp_fixed.zip).

Additional Information

Difference between the Resourcepacks: The rendertype_text.vsh from the minified unfixed version contains texelFetch(Sampler2,UV2/16,0) and in the fixed version it's texelFetch(Sampler2, UV2 / 16, 0)

image

Naghell commented 1 year ago

I think there is a problem in this version with the shaders in that file. I use HappyHud, I am a user of a Fabric modpack with several optimizations and the HUD looked fine (it should be noted that the plugin uses that file to place some elements), my custom textures were fine with Fabric in general, but with Optifine they were broken, especially the "spaces". I adjusted a little the textures with that file and some changes, it was solved but the problem was replicated in Fabric.

My theory is that they changed something in this version and that's why this problem is generated. I tried with all the 1.19.3 pre.