Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Maximum number (256) of shader global keywords exceeded

Discussion in '2020.1 Beta' started by truefx001, May 21, 2020.

  1. truefx001

    truefx001

    Joined:
    Jan 30, 2013
    Posts:
    132
    Hi I now get this Maximum number (256) of shader global keywords exceeded.

    keyword xxxx will be ignored.

    I never had this kind of thing happen in 2018.4 or before. My project updated to
    this 2020.1 version because of the 4GB resource file limitation fix.

    I have the ShaderKeywordsTool and it's telling me I have only 118 Shaders and only 155 Keywords.
    How to fix this and what is the impact of Unity ignoring keywords?

    Thanks
     
  2. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,352
    Ya I've seen this also it happened while upgrading to HDRP from builtin. I got rid of it by removing all my builtin shaders just because that was an option. But obviously that doesn't address the core issue.

    You might try deleting the shadercache in Library. Maybe it's counting unused shaders for some reason, it has to be getting that number from somewhere.
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,326
    LeonhardP and richardkettlewell like this.
  4. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,204
    Would splitting up the scene into two scenes help with the shader keywords? If you also get a win32 exception, then this would resolve it.
     
    Last edited: Sep 23, 2020
  5. truefx001

    truefx001

    Joined:
    Jan 30, 2013
    Posts:
    132
    @julianr I don't think so the shader keywords error appear at start of the project, so nothing to do with a scene. @Peter77 those keywords came about with the assets I have, so I'm not sure on how to change them out to be local keywords and this error is a new thing never had it in 2018 or 2017 version of the exact same project
     
    Last edited: Oct 10, 2020
  6. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,204
    yeah, I used the Shader Control asset to convert most of the keywords to local for now its a quick fix.
     
    TheGamery likes this.