Search code examples
unity-game-engineshaderoculusoculusquest

Maximum number (256) of shader global keywords exceeded, keyword Unity


When I try to compile my Unity project, and run it on the Oculus Quest, I get a list of errors:

Maximum number (256) of shader global keywords exceeded, keyword _METALLICSMOOTHNESSRANDOMOFFSET_ON will be ignored.
Maximum number (256) of shader global keywords exceeded, keyword _GRAYSCALE_ON will be ignored.
Maximum number (256) of shader global keywords exceeded, keyword _ISANIMATED_ON will be ignored.
Maximum number (256) of shader global keywords exceeded, keyword _LERPSONAR_ON will be ignored.
Maximum number (256) of shader global keywords exceeded, keyword _TOGGLESWITCH0_ON will be ignored.
Maximum number (256) of shader global keywords exceeded, keyword _INVERTCOLORS_ON will be ignored.
Maximum number (256) of shader global keywords exceeded, keyword _STARTPOINTENABLED_ON will be ignored.

I just updated Unity to the last version: 2020.1.15f1

How can I fix this?


Solution

  • I solved the issue deleting the ShaderCache files.

    Just go to the directory

    <Your Project Directory>\Library\ShaderCache
    
    • Close Unity
    • Delete all files in the directory "ShaderCache"
    • Open your project

    If that doesnt work buy the tool "Shader Control": https://assetstore.unity.com/packages/vfx/shaders/shader-control-74817