We’ve got a simple set of lit/unlit URP shader variants we use in the current version of our project. A clean build (no Library) takes upwards of two hours on a current-gen six-core i7 – 100 minutes of which is simply compiling shader variants. We use addressables, so the cost of compilation appears to happen twice when we build both.
I know 2020.1 is supposed to have improvements (~20%?) to shader compilation times, but is there anything else that can be done by us to speed this process up?
Hi!
The long compilation time comes mostly from the amount of variants that are needed. What platform are you targeting? Which graphics APIs are enabled for the build target?
This happens on win64, macOS, and iOS. In the case of iOS and macOS it’s just targeting the metal API. We have about 450 variants of 94 shaders, and I have made sure to explicitly disable unused lightmap and fog modes in the graphics settings.
By comparison, I’ve shipped another game with >450 shader variants in the standard pipeline and compiling shaders was barely a blip on the radar of build times.
Can you please send me (in a PM or attach here, whichever you prefer) Editor.log and all UnityShaderCompiler.log (these are inside the Library folder in your project)?
Or just open a bug report - we’ll take a look there