Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

When building, I get thousands of "Compiling Shader Variants"

Discussion in 'Editor & General Support' started by DreamPower, Dec 28, 2018.

  1. DreamPower

    DreamPower

    Joined:
    Apr 2, 2017
    Posts:
    103
    Every time I build, it takes a very long time to "Compile Shader Variants" for all the shaders that I have that are based on the Standard Shader. It looks like it is counting up the thousand variants over and over. What is happening, and is there a way to make it only do it once and never again until the shader changes?
     
    shomz likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What Unity version? I saw this behavior too with earlier releases of Unity 2018, but no longer see the issue.
     
  3. DreamPower

    DreamPower

    Joined:
    Apr 2, 2017
    Posts:
    103
    2018.1.9 - it's for Magic Leap, so I can't update to a newer build of Unity.
     
  4. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    This is a problem we are experiencing too. It began in 2018.1 but we still see it in 2018.3. It seems to grow with the amount of scenes that you are building. In general, Shader compile times seem to have exploded post 2017.3, to the point where we had to remove things like Standard Shaders (anything with thousands of variants) just to get our builds under an hour.

    This thread corroborates the claim from multiple sources: https://forum.unity.com/threads/compiling-shader-variants-taking-ages.527724/
     
  5. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,591
    Unity asked to submit a bug-report for this issue:
    https://forum.unity.com/threads/compiling-shader-variants-taking-ages.527724/page-2#post-3677809

    If you have a project where this issue reproduces, please submit a bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. You can post this Case number here (in this forum thread) for Unity staff to pick up, in case they see it.
     
  6. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    Issue still exists there must be 100s of thousands shader variants for 1 shader
     
    shomz, FardinHaque and BradZoob like this.