UE4 "Compiling Shaders" is super slow

materials
unreal
ue4

#21

i dont know how . but WOW


#22

Just checked it in 4.22. Works like a charm. What a discovery! Thanks @Travis :black_heart:


#23

See this is the good part about unreal, Unreal packs all those instructions and tries to merge most of them in the least amount possible. When you introduce things like a static parameter switch or a parameter boolean, The moment you use any of the two the code of the whole shader changes taking a completely different path and it needs to compile again.

Parameters are nice, I think the worst compile i had to deal with was the lighting mode for Surface forwardshading where it literaly takes ages to recompile.

A few things to note, Local derived caches are great, Use them.
First time opening a project or an upgrade will force a recompile.

PS: Everything you tick in the material settings literally introduces new code to the file, Think of it as a standard text where you just added new lines for a new case, Lets say two sided or a different lighting mode, Or supported by static lighting and so on, At least thats how i understand it @Bruno