UE freezes when saving a material that is related to current shader compiling

I changed some bools in my MICs and added some more parameters in my material parameter collection which resulted in heavy shader compiling, something like 26000. While shader compiling I changed the base material and saved that which resulted in UE4 freezing and locking me out. But in the task manager I can still see ShaderCompilerWorker doing their shader compiling.

Hi Davision -

Thank you for your report. We have assigned this issue to a member of our support staff, and they will begin investigation as soon as possible. If we are unable to reproduce the issue, or we need additional information, our staff member will comment here with additional questions. Otherwise, we will post an ‘Answer’ once we have logged the issue in our bug database or we have a solution for it.

In the meantime, please be sure to review our suggestions for how to report a bug, and feel free to edit your post if you have additional information to provide:

Thank you -

Eric Ketchum

Hey Davision,

Would you elaborate on the acronym MICs? Material Instance Constant?

If you are compiling shaders for a material that is referencing a master material, it is recommended you wait till the shaders have finished compiling before attempting to edit the master material. It other words, changing the child of a parent, applying the shader changes, and then editing the parent at the same time is going to cause your materials to need to re-compile again.

This is why you were able to see the processes still running even though your editor was frozen. Another question, how complex is the material your are attempting to save and apply the changes?

Would you also mind providing me with your computers ‘dxdiag’?

Thank you,

I don’t even have to click compiling for it to recompiling. When I add a new material parameter in the material parameter collection it instantly starts compiling 6000 shaders. Now if I add another parameter it adds another 6000. So I now have to wait for 12000 to compile.
To be me it seems the automatic shader compiling is rather stupid. Like in that described case it compiles the shaders twice, the base shader + the childs (material instance constants) x2. Since I’m now at 38 material parameters in the collections and ca 90 MICs you can imagine that this rather simple shader compiling took in total hours. All for 1 actual material/shader that is not complex, only complex if a static bool for every of the 38 material parameter of the collection is complex (I have 38 rivers now and each needs its own parameter they also have different segments that need different MICs)

Is there a way to abort shader compiling or reset shader compiling or turn automatic shader compiling off? It also bugs me with the terrain painting where it was constantly recompiling for the different terrain components and that also with very high counts.

link text

P.S. Currently waiting for 46000 shader to compile.

Hey Davision,

I found within the documentation the location to turn off automatic shader compiling. Turn off the Live Update option within the Material Editor and your issue should clear.

Live Nodes and Live Update

I would also take a look at the Material Parameter Collection documentation as it has some useful information on its limitations in case you run into an issue there as well.

Cheers,

I also found this within the Material Parameter Collection doc.

Limitations and Performance Characteristics

"A Material can reference, at most, two different MaterialParameterCollections. One is typically used for game-wide values while the other can be used for level specific parameters. A collection can have up to 1024 scalar parameters and 1024 vector parameters.

Modifying the number of parameters in a collection will cause a recompile of all Materials that reference that collection. If you need to add numerous parameters, it can be faster to add a lot of parameters up front in an empty map.

If you rename a parameter, any Materials referencing that parameter will continue to work as expected. However, any Blueprint referencing that parameter will now be broken. You must reassign the ParameterName of the Blueprint function which operates on the collection to fix this.

Updating values in a MaterialParameterCollection is much more efficient than setting many different parameters on various Material instances."

I have those settings usually turned off but that trick with the material parameter collection is really helpful.
Another issue with it I found that it sometimes even recompiles when I simply open a material instant constant. For that river master MIC that is 9000 shader compiling again without any apparent reason.