Running out of Shader Keywords

If you are using other assets or if you’ve written some complex shaders yourself you may run out of shader Keywords. Unity has 256 possible global Keywords for shaders, Unity itself takes around 60 of them, so the user has around 190 available Keywords. This asset uses many Keywords, so running out of them may be a possibility if you are using other assets. So what’s the solution? Since Unity 2019.1 Unity has included local Keywords. This asset is prepared to work with any Unity version and that's why these local Keywords aren’t used. But if you are on Unity 2019.1 onward this is what you can do:

  1. Go to: AllIn1SpriteShader/Resources

  2. There you'll see the Default version, the UI Mask version and the Unscaled Time version

  3. Open all of them or just the Default one if you don't use the others

  4. Change all shader_feature for shader_feature_local (in visual studio ctrl+f will open the search and replace bar)

*Unity will only accept 64 local keywords (shader_feature_local), with new updates and features the shader has slightly surpassed this number. You will need to leave out a few keywords as global keywords (shader_feature). Keep in mind that you will only run out of keywords if you have other assets with big shaders in your project and that in any case you can just replace the keywords on those assets to be local too.

Last updated