Oh dear, I deleted the Library folder and then 'reimported all' and now all my shaders are pink in the editor.
Now, whenever I try and interact with a Spine game object my editor hangs for a few seconds:
and I can't click anything because then I'm back into that state, and so I have to shut Unity and open it again.
The six hour build for compiling shader variants was definitely present (for me) in Unity 2020.1.9f1 and again when I upgraded to 2020.2.7f1 yesterday, but after reimporting I seem to be in an even more broken state.
Clearly, there's something very wrong with my Unity project and how Spine is interacting with it, and I'm going to have to look into recovering this.
Okay, I've rolled back the state of my project to 2020.1.9f1, and escaped whatever totally broken state I found myself in in 2020.2.
Still though, after a deletion of (now safe) deletion of /Library/ and after a reimport, I'm still experiencing those long, long Build times. Harald, when you compile a URP project + URP Spine Shaders, are there not hundreds of thousands of variants that need to be compiled the first time around for you? Or do you have those hundreds of thousands of variants needing compilation, but it completes them very quickly? Just trying to determine whether there shouldn't be this build work being done, or whether it does get done, just usually much faster.
Now I'll try and replicate this in the clean new test project you described, see if I can reproduce the issue there.
I've tried creating the test project by:
-
Select URP from Unity Hub's create project list, using Unity 2020.1.9f1.
-
Add the latest versions of Spine Unity and the URP shaders package to the new project.
-
Change to the 'URP 3D Shaders' scene, and add it to the 'Scenes In Build' list.
-
Build...
... and it still takes hours? Despite the Unity upgrade difficulties I've mentioned in this thread, this makes me think it's not anything specific to my game project, but rather just the length of time it takes to compile all these shader variants on my hardware. I could send you a copy of my project but I genuinely just followed those four steps above and wasn't hard to replicate.
Okay, so rather than being a Spine Issue, or something on my end, this is... a Unity problem. Hooraaaay...
There's a huge thread over here: https://forum.unity.com/threads/compiling-shader-variants-taking-ages.527724/
And a second one over here: https://forum.unity.com/threads/shader-graph-takes-unbearable-long-time-to-compile.724247/#post-4847420
And probably some other threads as well. I've tried a few suggestions that have worked for other people, and I have brought it down from 6 hours to about 20 minutes, an improvement. But that's going to be an hour or two on my old Mac hardware, I suspect. Something to try tomorrow.
Harald, anything in those threads that stick out to you? It's the Spine shaders that this Unity issue is tripping up on, because there's hundreds of thousands of variants, or so Unity thinks.