I’ve edited the standard shader and replaced all the 2d maps with TEX2DARRAYs and I’m sampling them via UNITY_SAMPLE_TEX2DARRAY. In the editor it works like a charm. However, when I go to the standalone player it just shows geometry that is completely black.
I managed to pinpoint the point of failure, and I think it is inside the fragForwardBaseInternal method. I know the textures are loaded properly, because if I override this method with just this:
half4 difCol = UNITY_SAMPLE_TEX2DARRAY(_MyArr, myCoords);
half4 specCol = UNITY_SAMPLE_TEX2DARRAY(_MetallicGlossMap, myCoords);
and return color from that, it shows correct texture.
I haven’t touched the functions inside FRAGMENT_SETUP or the lighting code. So it must be failing somewhere among these methods:
FRAGMENT_SETUP, FragmentGI, UNITY_BRDF_PBS, UNITY_BRDF_GI - none of wich I edited.
Why does this happen? Why does it happen ONLY in the standalone player? I’m not using any shader emulation inside the editor, the shader version is the same between the editor and the player? What’s going on?
Edit:
Also, I read that it could be some shader code missing. So I included the shader to be always included in the build, but then the build gets stuck at globalgamemanagers.assets, I let it run overnight, but it never finishes, just freezes. Why?