The poor performance of Materials/Shaders in UE4 has been a great deal of frustration for me…the first video below should illustrate how bad this is.
If i make a very simple change to a material ie color. it takes at least 2 mins 30 secs to preview/nodes, show in the game editor, and update the swatch in content editor…
However if I manually boost ShaderCompileWorker.exe’s priority to Above normal it takes seconds…
As you can see I have to do it couple of times, I guess UE4 re-spawns the process a couple of times( in this simple example)…
How can I permanently set the exes priority to Above Normal or even just Normal?
(I’ve found an app called prio that might temporarily fix this…just testing that now…)
Prio works but there is a bit of a delay, it has to poll for the app and update the priority. Would be better if this was an option or default in UE4
not sure if you have found this or not, but it is also configurable in the options. if you reed the very next line :
GConfig->GetInt(TEXT(“DevOptions.Shaders”), TEXT(“WorkerProcessPriority”), PriorityModifier, GEngineIni);
its reading an option from Engine/Config/BaseEngine.ini
in that file do a search for WorkerProcessPriority which will also equal -1, simply change that and it will use that value instead.
the following numbers match priority:
-2 = Low, -1 = Below Normal, 0 = Normal, 1 = Above Normal, 2 = High
hmmm you must be a few revisions ahead of the code I looked at…but still my ini file( v 4.25.4) does not have that value…I’ll add it and see if makes a difference.
My cpu has changed since …but adding WorkerProcessPriority=1 to DevOptions.Shaders seems to make a difference!..I only did some vey quick testing though…
I don’t understand why you have to make this solution confidential, why don’t you share the folder location, file name and command line to be changed?
Type “shadercompileworker” Press Enter
Change WorkerProcessPriority=-1 to WorkerProcessPriority=1
I have set the ProcessWorker in the BaseEngine.ini to the Value 2. Which is the highest i think.
But the engine still takes ages to load the 6000 shaders when it starts up the project, every single time.
I can not believe that it is an issue with my hardware, because the CPU is at 12% and the GPU is at 3%
My RAM is at 33%
So it clearly isn’t even trying to work faster. Its just super slow for some other reason.
End of April 2023 and 5.11 is STILL recompiling all shaders upon project open, even if you only open close an open again, (and around 6,000 for me too) As far as I can tell,. 5.2 is doing the same,… So much so way more ‘efficient’ shader calcs.
Changing the Priority of the Shader process in the Unreal Ini is not intended to bypass or remove the need to compile project shaders, it only tells your PC to prioritize the shader compilng more than other periferal tasks. There are other ways to mitigate the shader compile time by in a way “caching” the compilied shaders for a standard project. Hope this helps you better understand what this thread helps you achieve!
Do you have ray tracing enabled or disabled?