Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Why Unity compiles shadres for dedicated server (no graphics) build? Maybe it should be disabled?

Discussion in 'Editor & General Support' started by ViacheslavRud, Mar 21, 2023.

  1. ViacheslavRud

    ViacheslavRud

    Joined:
    Aug 1, 2018
    Posts:
    24
    Unity 2021.3.21f1 HDRP
    Shader variants compilation takes a lot of time, would be better to skip them for the console build.
    If it is possible.
     
    kmowers likes this.
  2. kmowers

    kmowers

    Joined:
    Dec 12, 2016
    Posts:
    15
    I also have been wondering how to skip shader variants compilation for dedicated server build! Can someone enlighten us please
     
  3. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    How do we tag Unity Team on this issue??? I am not intentionally loading any shaders on server side but yet my dedicated linux server build with no graphics also does the same, trying to load shaders.

    i though Unity Dedicate Server build was suppose to strip shaders by default?
     
  4. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    249
    Last edited: Oct 3, 2023
    nasos_333 and jonkuze like this.
  5. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Thanks soo much!!! This is very helpful!
     
  6. RikuTheFuffs

    RikuTheFuffs

    Joined:
    Sep 9, 2013
    Posts:
    15
    @cristianm_unity Is there an API for enabling this in a build script?

    EDIT: I'm on 2022.3.2f1 and can't find it in any way, not even in the Player Settings window. Was this added later on?
     
    Last edited: Oct 5, 2023
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,628
  8. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    249
    Indeed, it was added recently to 2022.3. So I'd recommend trying it in the latest 22 LTS.
     
  9. andre_6865

    andre_6865

    Joined:
    Feb 23, 2018
    Posts:
    7
  10. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    249
    @andre_6865, usually enabling the option should be enough. I can have a look, what can you tell me about your project? Editor version, render pipeline, type of shaders.

    Or even better, if you could create a bug report where you can attach a repro project that'd help us a lot.
     
  11. AlexandrKvitka

    AlexandrKvitka

    Joined:
    Jun 11, 2022
    Posts:
    12
    I have the same issue. When I run the server, I get warnings about shaders. I use Unity 2022.3.10, URP, and Entity graphics. I just have updated Unity to 22.3.20, but Unity compiles shaders anyway, and I think there will be in the build, too.
     
    Last edited: Feb 21, 2024