Search Unity

Unity Shader Variant Error on Build

Discussion in 'General Discussion' started by zzkontaz, May 16, 2021.

Thread Status:
Not open for further replies.
  1. zzkontaz

    zzkontaz

    Joined:
    Sep 17, 2019
    Posts:
    8
    Hello everyone, I am having trouble with a strange error.
    I am using the Unity Engine about four years but I didn't see this kind of error.

    When I want to build the game with custom shader from Asset Store (Flat Kit), or Stylized Grass shader;
    Unity fails the build then gives me error:

    "FlatKit/Stylized Surface has too many Shader variants(9437184).."

    It says "remove this Shader from the Always Included Shaders list" but if I do this builded game shows me pink no shader textures.

    This is the error: unityShaderVariantError.png



    This Is Game View In Editor:
    needToBuild.png





    Unity Version: 2020.3.8f1 Personal DX11

    My Specs:
    Intel core i7-10750h 2.60 GHz,
    16 GB Ram,
    Nvidia 1650ti 4GB

    I'm gonna miss the deadline if can't fix it. Anyone can help me?
     
  2. zzkontaz

    zzkontaz

    Joined:
    Sep 17, 2019
    Posts:
    8
    Edit: This is the scene after the build without adding shader variants on "Graphics Settings" errorBuild.png
     
  3. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,144
    Ask asset developers for support involving their assets. We can't tell you what the potential shader variant issues here are.
     
  4. zzkontaz

    zzkontaz

    Joined:
    Sep 17, 2019
    Posts:
    8
    Thank you for your answer, but I want to know is there any possible way to dont get the " Too many variants" error on build. Because I must use them.
     
  5. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,144
    Why "must" you use every shader variant?
     
  6. zzkontaz

    zzkontaz

    Joined:
    Sep 17, 2019
    Posts:
    8
    Oh, I am sorry for my bad language. English is not my first langue.
    I was saying " if I was remove the shaders from (ALL SHADERS INCLUDING URP MATERIALS), graphics settings include list. Game building with pink error textures. If I add the shaders on the list, Unity crashes without errors or gives me the error that I posted for this topic.
    I searched about this error but I did not found no one had this error before. This is very different error to me.

    As I say, I developed a couple finished games with this engine, but I didnt get this type of error until this time.

    BTW thanks for supporting, I am open for any different solutions :(:D
     
  7. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,154
  8. zzkontaz

    zzkontaz

    Joined:
    Sep 17, 2019
    Posts:
    8
  9. zzkontaz

    zzkontaz

    Joined:
    Sep 17, 2019
    Posts:
    8
Thread Status:
Not open for further replies.