Taking forever to edit a shader in 2020 compared to 2018

Greetings,
I have a custom toon shader I haven’t worked on for two years that I decided to tweak a little again for my project. Since I started on it I have upgraded from Unity 2018 to Unity 2020. What I noticed is that it now takes over a minute for Unity to implement the edits I do to the shader, compared to maybe a second or two before. I used to do a lot of shader editing simply because it was the fastest way to script anything for Unity, but now it is the complete opposite.

How and why?

Hi!
Can you please send a bug report?
I’ve seen only a single occurrence of this problem, and didn’t get a bug report yet.

I can send a bug report once I am home. I am going to try in 2019.4 now.

1 Like

Thank you!

I found a possible solution, posting it here for anyone that may have the same issue.

The time was reduced from 1.5 minute to less than 2 seconds !!

I disabled the following option:
Project Settings - Editor - Shader Compilation - Asyncronous Shader Compilation

I tried it in Unity 2019.4, same as 2020. Still slow here…

Which 2019.4 version ? I used 2019.4.5f1 and urp and this change fixed the issue, but can be anything i suppose.

2019.4.8f1 using default rendering settings (I haven’t edited anything).

the

The default uses the asynchronous compilation, that is why the problem appears, so must remove the default in this case

Dear,
I am running into this issue as well. My project in URP (Unity 2020.2.7) holds a large number of sifferent shaders, and trying to update a prefab to change a shader takes a few minutes… Totally unusable.
I tried disabling the asynchronous shader compilation, but that does not seem to help.
I also haven’t seen replies in forums thread that this was confirmed to be the cause.
Anybody can confirm officially ?
Anybody has an idea on what else would cause that extensively long time ?

Thank you,

what pipeline is used ?

initial post updated, sorry I forgot to mention URP

Generally from what i have seen pipeline shaders are way slower to compile too than standard pipeline

I get this feeling as Unity and pipelines progress everything is getting extremely more demanding in PC to develop a game and seems very unoptimized.

@bdeschryver how large is your “Library/ShaderCache.db”?

I got same issue, taking long time to change shader.

Large of ShaderCache.db in my project is 9GB more or less.

Nb:

  • using URP pipeline
  • Unity 2020.2.5f1

@GeroNL the issue has been fixed in 2020.3.0f2

1 Like

ok, thanks aleksandrk

but if someone still not want to do it(update to that version), and not much use variant of shading in the project or maybe go new project and got some this issue(cause maybe you copy all file from last project) you can delete ShaderCache.db and ShaderCache(Folder), but if in your project use many variant of shader, it will take longer in the time you using it.

Just killing ShaderCache.db would be enough.

Hi, is this related to the issue where shaders can take 10-20x longer to compile when the async compilation mode is enabled in the settings ?

No idea. I haven’t yet seen a reproducible bug report on the async issue.