Closed Sergster1 closed 7 months ago
Please send the broken generated shaders & materials here as described in the readme.
Hi my apologies for missing that part and for the delay. This should contain the requested files.
Edit: Files scrubbed due to containing proprietary code
Ok after looking at it it seems like this needs to be fixed on their end and not mine. I think marking any of the properties under the advanced section such as smoothness while having the advanced section disabled and then locking the shader also causes this error.
Here is a technical description of what happens that you can pass along to the creator of the module:
The module hides the variable declarations in the advanced section with an //ifex _ExsyGlitterEnableAdvanced == 0
. Specifically these 6 variables get not declared when the advanced section is disabled.
_ExsyGlitterSmoothness
_ExsyGlitterRoughnessX
_ExsyGlitterRoughnessY
_ExsyGlitterMicrofacetArea
_ExsyGlitterMicrofacetDensity
_ExsyGlitterDensityRandomization
Then later in the code the variables will get used regardless of if the advanced section is enabled or not. This incidentally works when using poi lock in as long as those variables are not animated as the variables will get replaced inline with its value. When marked as animated the variables will not get replaced and the shader errors since the declarations are gone now. My optimizers lock in is a bit different as it replaces the variable declaration when found with a static variable initialized to the value of the property instead of inline replacing it with the value. This means that my optimizer always stumbles upon this error. The fix would be to either never hide the declarations with an ifex statement or to also hide the usage of the variables with ifex inside the code. There might be similar issues with other variables and sections too, I only looked at the immediate error from this bug reports shader.
I am going to close this issue as not a bug since it comes from incorrect ifex usage of the module and there isn't really a way for me to fix this on my end as far as I can see.
And as a workaround, locking the shaders beforehand might just work!
Using https://exsy.booth.pm/items/5492450 causes d4rk to throw a undeclared identifier error and the resulting upload drops the material used by the shader.