- Home /
Shader EnableKeyword Standalone version
I need to create a material at runtime loading custom standard shader from resources and set some properties. The problem is that it works perfectly in Editor, but in standalone version it seems that the enable keyword doesn't work and because of that I cannot make material transparent or assign normal texture. This custom standard shader is almost the same as the build-in standard shader, so it isn't a problem with shader. My guess is that Unity compiles only one version of the shader instead of all possible. Any help appreciated. I can provide with additional information if needed.
//Checked
I added material to resources folder that isn't used anywhere and now the transparent variant of custom standard shader works. Is it possible to force compile all variants of the custom shader?
//Solution
Found solution. Had to add shaders to Always included shaders. Building is a bit longer and during bulding Unity freezes, so it isn't the best solution, but works.