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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question Unity makes long building time and recompiles shaders while switching between platforms

Discussion in 'Editor & General Support' started by sachaamm, Mar 20, 2023.

  1. sachaamm


    Apr 11, 2016
    Unity ( 2021.3.11f1 ) makes long building time and recompiles shaders while switching platform ( back and forth from Standalone Windows to Linux Dedicated Server ), around 30 minutes per Build because the editor is compiling all variants shaders from the project, which contains graphical assets dependencies. Usually editor caches shaders for the same building platform but because i switch between these 2 differents building platform shader cache is erased, causing very long deployment time. what can i do ? i thought to duplicate my project with a specific one for each building platform, but it's really not ideal solution...
    I noticed that all shaders are recompiled only when i switch back to Dedicated Server Linux, Windows still have the shader cache but Linux always recompile. this is pretty annoying because:
    - I don't understand why Dedicated Server needs to compile shaders, dedicated server is basically a console application
    - I don't understand how to simply remove all shaders from build. I ordered Shader Control from the Asset Store, but again it seems to work only with Windows Standalone.
    Last edited: Mar 21, 2023