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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

HD SRP: Shader Compilation Time

Discussion in 'Graphics Experimental Previews' started by KnightsShadow, Mar 17, 2018.

  1. KnightsShadow

    KnightsShadow

    Joined:
    Jan 21, 2013
    Posts:
    14
    When trying to build my project I´m experiencing very long shader compilation times between 30-60 min. And results do not seem to get cached. Is there a way to reduce the time compilation takes? Or will this be addressed in the future?
     
  2. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
  3. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    The shader compilation time is due to the amount of variants in the HD lit shaders. Currently we don't have a way to strip multi_compile variants. We are working on a solution for that at the moment.

    This problem also affects LWRP. In LWRP we made some compromises to decrease multi_compile as it's worse on mobile due to available system memory/non binary shader support in most mobiles.
     
  4. KnightsShadow

    KnightsShadow

    Joined:
    Jan 21, 2013
    Posts:
    14
    I am fine with longer build times as trade in for better quality shaders.
    Interestingly most shader variants compile pretty fast. Only a few ones take FAR longer than the others.