Hello! Thank you for visiting my post. I ask for help in solving one not a big problem.
I use Spine and Todd River's Shader - Pixel Lit. ( https://github.com/traggett/UnitySpriteShaders ), since i do not just need to drop the shadow, but also receive shadow (which Spine / Skeleton can not boast).
I ran into the following problem:
My object is created in realtime, and i cant configure it through the inspector in advance. In fact, I can not even copy my object in prefab, since its mesh is created at runtime.
So i need to change the parameters using the code. I rummaged through the script for the editor (SpriteShaderGUI) and took a couple of functions from there.
As a result, my configuration code looks like this:
SetBlendMode(material, eBlendMode.StandardAlpha);
material.SetTexture("_BumpMap", GameObject.Find("TestObject").GetComponent<Res>().normalMap);
material.SetFloat("_ShadowAlphaCutoff", 0.635f);
material.SetFloat("_Cutoff", 0.6f);
material.SetFloat("_ZWrite", 1.0f);
SetMaterialKeywords(material);
As a result, everything is perfect in the editor. The shader is configured and i can safely work, but in the standalone build for Windows the parameters seem to be not applied and the object itself becomes very dark.
Perhaps this is due to the fact that I do not include the Pixel Lit shader in Graphics-> Always Included Shaders, but I throw it in ShaderVariants, since if i throw it in Always Included Shaders, then I get this madness:
Who faced the similar problem? Maybe I'm somehow not correctly changing the parameters of the shader?