Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Compiling Shader Variants Taking Ages

Discussion in 'Shaders' started by Nigey, Apr 20, 2018.

  1. ekakiya

    ekakiya

    Joined:
    Jul 25, 2011
    Posts:
    81
  2. hahman12

    hahman12

    Joined:
    Jul 21, 2017
    Posts:
    2
    Super old post, but hoping to help anyone who's looking for answers in 2023.

    If you're using HDRP and have noticed this issue, it could be because some of your shader graphs have a URP variant. Double check any packages you may have downloaded (like 3D models, environments, etc) for any shaders that have HDRP and URP both listed under "Active Targets". Remove URP from that list. Should cut down on build times significantly.
     
    brookcliff and RoyBarina like this.
  3. angeldevelopment

    angeldevelopment

    Joined:
    Sep 28, 2022
    Posts:
    247
    Still having this issue in Unity 2022.3.8f1 URP
     
    DavidZobrist likes this.
  4. oAzuehT

    oAzuehT

    Joined:
    Feb 14, 2020
    Posts:
    9
    Hold my beer.
     

    Attached Files:

    Neiist and djarcas like this.
  5. DavidZobrist

    DavidZobrist

    Joined:
    Sep 3, 2017
    Posts:
    234
    It often happend after upgrading the unity editor version. I think it might be related to not properly upgraded URP shaders /materials leading to multiple instances of the same mats/shaders geeting compiled. For me running the material upgrader ( only materials selected) did the trick. I let it run for 27 hours and it stook on 70% I canceled it. But affter this build times are normal again. I did have this same issue atleast 2-3 times in the last 2 years when upgrading unity LTS versions and this mostly fixed it.


    ( one would think killing the library folder would also do it then but it doesnt!)
     
  6. DavidZobrist

    DavidZobrist

    Joined:
    Sep 3, 2017
    Posts:
    234
    Nah ok that didnt work the build time was back to normal but the addressables cant be found anymore, neither on the previous / currently working bucket and not even the local builds.
    They seem to be somehow corrputed.

    All in all upgrading from 2021 lts to 2022 lts is a horror trip.
     
  7. thedrhax14

    thedrhax14

    Joined:
    Aug 7, 2014
    Posts:
    38
    Somehow, upgrading the Nvidia Game Ready drivers from 545.xx to 551.23 managed to completely eliminated stalled shader compilation process. I was compiling a project with very little amount of assets and simple lit URP materials and even that was taking 30+ minutes with no real progress. After upgrade it was done in 8 minutes.
     
    DavidZobrist likes this.
  8. skrttdoosh

    skrttdoosh

    Joined:
    May 17, 2023
    Posts:
    5
    Hello all, first of all I am a shader noob, I don't understand shaders. I was reading the forum and saw someone mentioned this. I went to check my shaders and saw the following image. Is the number of shaders and total variants normal? I have imported nature stuff from the Unity Asset Store (Nature Manufacture's stuff which has their own...shaders?) into the project and don't know which are the shaders being used in the project currently, and if there's a need to delete other unused shaders.

    The issue I am facing is long build times. I was simply building only one scene which didn't have a lot of things in it. It only had terrain, some trees and foliage, waterbodies like a river and a small lake, a house made of modular assets, and some other things, and I wanted to quickly test the scene for all my game interactions, but one single build can take up to 15-30 minutes, which is nuts and not productive for me. Can someone enlighten me?
    upload_2024-2-10_3-23-38.png

    upload_2024-2-10_3-24-15.png
     
    DavidZobrist likes this.