Open GeForceLegend opened 1 year ago
Still exist in 1.21.1 J1. This is mostly happen when shader developers merging vert and frag shader source to one file, and using defines to use part of it, like the code below:
#ifdef VSH
// vertex shader file, including those uniforms
#else
// fragment shader file, including those uniforms too
#endif
Changing fragment part to the top can save it, but this also should be considerd as a macro parsing issue, meaning Optifine skipped, or ignored some macro branches when parsing.
Description of Issue
With certain macro blocks, Optifine will consider shadowtex and shadowcolor is not used even its actually used in shader source. When happening, all shadowtex and shadowcolor samples will result in black, and anything uses shadow matrix (including custom uniforms) will be absolutely wrong.
Steps to Reproduce
I'll provide an exmaple shader, and here is its core code: There is an include file
test.glsl
with code below:And in composite.fsh, we use this include in this way:
If
TEST
is not defined, no shadowtex or shadowcolor will be considered as used, and then Optifine will not even call the shadow pass.OptiFine Version
1.20.1 I5
Installation Method
Standalone
Log Files/Crash Reports
If the
TEST
described above is not defined, info in log says that no shadowtex or shadowcolor is used;But if
TEST
is defined, everything just looks fineF3 Debug Screenshot
If
TEST
is defined: If its not defined:Additional Information
shaders.zip