Hey all,
I have a decent sized project (27 GB, HDRP) and am trying to test out and add multiplayer features. When I first started the project the build times were usually less than 8 minutes now I am looking at 2 to 3 hours. I’ve tried a few tricks I found online like Strip All shader instancing and saving preloaded shader assets for each scene. The build always seems to be stuck at compiling shader variants.
Does anyone know a way to reduce the time?
Thank you.
Disabling HDRP features is one of the only solid ways I’ve found so far. It defaults to everything on…
Ensure you disable features you know you’re not using in your build (including the Runtime Debug Display, which introduces a lot of variants, but is very useful).
Otherwise there’s a pre processor for manually stripping variants which I’ve yet to get working, but this has the potential to remove a lot of extra crud as by default, HDRP/Lit
has a lot of key words which are not stripped (link).
What we’ve had to do is have our build machine keep a shader cache and reuse it when branch swapping as it was taking nearly 4 hours per cache rebuild… If I want to do a clean build locally I have to build over night and then be super careful what shaders I change moving forward.
But once you’ve got a complete shader cache, it should be much much faster, it’s just that first build which is the most painful 
1 Like
I’ve noticed this thanks for the response! In terms of the other problem I managed to solve it by seperating the prefabs into their own folders. For some reason it appears Unity loads everything in every prefab once the folder is open caused my RAM to crash at over 120 gb/s!