Search Unity

  1. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice

Help Wanted 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:
    126
    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,221
    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:
    5,581
    LeonhardP and richardkettlewell like this.
  4. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,167
    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:
    126
    @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,167
    yeah, I used the Shader Control asset to convert most of the keywords to local for now its a quick fix.
     
    TheGamery likes this.
unityunity