Shader Compiling Really Slow

I’m using UE 4.19 and everytime I make a change on a material (It can be a simple color or texture change) the shaders start compiling in a slow way. I tried doing the same action in 4.18.3 and the changes on materials are almost instantaneous.

Does anyone know if the new version is having some problems?

Thx for the help.

Hi , This is indeed true.
My UE 4.19 took over one hour to compile shaders, for an Android Launch
My PC was under full stress for the entire duration.
I request the development team to look into this issue as well.

This appears to be resolved for many users (including myself), by changing the shader-compiler’s windows task priority:
This page has a fellow with some degree of solution.

[Update]
provided me to a small utility he wrote to compensate for this issue without recompiling the engine:

Thank you for posting that link, setting the priority higher does make a difference. Just a bit annoying you need to keep setting it every time you use the engine.

Might look into creating a pull request where the priority could be changed in an ini file rather than needing to build from source just to change that one line.

If you do, I think a fair number of people would endorse in - it’s odd to have a hard-coded value for something so vital.

@ I’ve updated my post with a small utility.

Awesome! Not sure I would have been able to look at this for a while, just slammed currently, so that’s great someone was able to create this

Thank for me!! and thanks for letting me know! I’ll start posting this fix into all the other shader compiler is slow threads I come across. :slight_smile:

@ I clicked on exe but it didn’t work and the compiler was still slow

i can’t even find an exe file…

what exactly didn’t work?

Heya!

I have this issue in 4.20 and it seems that the PriorityModifier is still on -1.

You can change it manually in the Task Manager for sure but whenever you restart the editor it’s going to reset.

I’m not sure this is all there is to the problem though. Even though I set it to High priority it takes waaaay longer than before.

Hey Guys! There is no .exe file. You need to compile the code. I’m having trouble at compiling though. :confused:

I was able to compile. But still, it didn’t help me.

I tried using the code, but no change was made. The .exe runs but it seems the engine always try to keep the original priority, and the fix has to keep trying to change it. I haven’t noticed big changes even with the fix cause Unreal keeps changing the priority and shaders keep going slow.

The fix’s logs became insane, lol.

I downloaded the version 4.18 again, since I’m just working with render by now. Hope it gets fixed soon.

Thx everyone for helping.

This trick will only work if u have a single core CPU or if UE4Editor.exe is eating and up more than 1/(Total cores if ur CPU). For my UE4Editor and 3 ShaderCompiler exe is taking up 25% of all CPU’s so no performance gain.

I want to bump this to try and have UE devs say if we’re doing something wrong or if it’s something they’re going to fix.

Having same issues. Thousands of shaders for a minimal test project with about 5 materials. Almost identical Unity project uploads very quickly. On Unreal I’m waiting ages with computer locked up.

I’ve found that disabling XGE shader compilation really helps with stability and percieved speed. With default settings, I save a material and UE4 locks up for 5 minutes, regardless of complexity, it also spawns very few shader compiler threads.

Disabling XGE stops the lockup from happening and creates as many shader compilers as it can to use up most of my CPU.

Check the ConsoleVariables.ini for these lines “; r.XGEShaderCompile is now enabled by default in source. Uncomment to disable XGE shader compilation.
r.XGEShaderCompile = 0”

Can confirm this. Just tested it on the free Fantasy and Medieval Architecture Kit pack from the Marketplace. 3 mins to compile materials when this line is commented and 1 min when it is uncommented. Also the Material Editor is more responsive, no more compiling hundreds of shaders for the simple changes and no more annoying sound signal. Need to test it more but for now it works.

Thank you wickerman123.

I’m incurring in the same problem. I’ve started study game programming from less than 1 month, so I’m not so good with programming at the moment and I don’t know what I have to do to uncomment that line or where I can find it. Please, can you describe me the process to follow to solve the problem?

Sure.

  1. Open the file “C:\Program Files\Epic Games\UE_4.22\Engine\Config\ConsoleVariables.ini” in any text editor.
  2. Find the line “; r.XGEShaderCompile = 0” and remove the “;” in the beginning of the line to uncomment it.
  3. Then just restart the editor.