# \[UE5\] Compiling Shaders On Every Startup

**URL:** <https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** unreal-engine, Performance\
**Created:** [April 8, 2022, 10:09pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971 "2022-04-08T22:09:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattDeakin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MattDeakin](https://forums.unrealengine.com/u/MattDeakin)\
**Post date:** [April 8, 2022, 10:09pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/1 "2022-04-08T22:09:25Z")

</div>

Hey! I started learning UE5 last week just before the release the other day (I’ve since updated to the latest version). Since starting I’ve noticed it says “compiling shaders”. I tried to look into this more but most of the information is for UE4 and didn’t work for me on UE5. I know this has been asked a lot before, but like I said most information is for UE4.

From what I understand it’s only supposed to do this once (or after a big project change) and store it in some sort of cache so next time it’s a lot quicker? For me, it compiles it every time I launch the same, basic project with no changes and it takes roughly 30 minutes to compile sometimes over 8,000 shaders. Then sometimes does it again when the editor has actually opened. This is very annoying as I have to plan when I want to be creative and can’t do much else with my computer in the meantime.

I haven’t got the most high-end computer possible but seems fine running UE5 after the shaders have finished compiling. I understand it’s probably important for UE5 to function fully but surely you shouldn’t have to plan an hour before every time you want to use UE5?

This software looks awesome and I really can’t wait to use it properly, but at the moment it just feels very discouraging to use and I really don’t want this to put me, or others, off learning it because of this.

---

<div class="post-metadata">

**Author:** ![Blindspy4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Blindspy4](https://forums.unrealengine.com/u/Blindspy4)\
**Post date:** [April 15, 2022, 12:14am UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/2 "2022-04-15T00:14:26Z")

</div>

I’m also having this problem. What’s worse, is that the actual compilation is moving at a snail’s pace (much more than an hour for me). I have a 12-core 24-thread processor but the editor is only using 5-6% of my CPU to compile the shaders. Really hoping someone has a fix for this.

---

<div class="post-metadata">

**Author:** ![yaoyuh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yaoyuh](https://forums.unrealengine.com/u/yaoyuh)\
**Post date:** [May 4, 2022, 3:17am UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/3 "2022-05-04T03:17:07Z")

</div>

This might help [(994) Compiling Shaders Unreal Engine 5 start up issue FIX FOR MAC IOS - YouTube](https://www.youtube.com/watch?v=ZHHZsz2YvjI)

The same solution is also mentioned here [UE4 "Compiling Shaders" is super slow - Real Time VFX](https://realtimevfx.com/t/ue4-compiling-shaders-is-super-slow/3163/24)

Tried it, and the start up speed does become fast. However, shaders are compiled when I open an existing project. And the compilation is as slow as before. I try to modify the WorkerProcessPriority value in the BaseEngine.ini configuration file. Then the compilation becomes faster.

---

<div class="post-metadata">

**Author:** ![TomG\_Sandfall](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tomg_sandfall/32/1008648_2.png) [@TomG\_Sandfall](https://forums.unrealengine.com/u/TomG_Sandfall)\
**Post date:** [May 4, 2022, 9:44am UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/4 "2022-05-04T09:44:20Z")

</div>

Regarding worker count, UE5 introduced some new settings in BaseEngine.ini: ShaderCompilerCoreCountThreshold and PercentageUnusedShaderCompilingThreads. The documentation is quite self-explanatory:

```auto
; Core count threshold. Below this amount will use NumUnusedShaderCompilingThreads. Above this threshold will use PercentageUnusedShaderCompilingThreads when determining the number of cores to reserve.
ShaderCompilerCoreCountThreshold=12
; Percentage of your available logical cores that will be reserved and NOT used for shader compilation
; 0 means use all your cores to compile Shaders
; 100 means use none of your cores to compile shaders (it will still use 1 core).
PercentageUnusedShaderCompilingThreads=50

```

From what I understand from ShaderCompiler.cpp:3427, for a machine with 24 threads, this new default has the side effect of changing worker count from 21 (24 - 3 unused defined by NumUnusedShaderCompilingThreads in BaseEngine.ini) in UE4 to 12 (24 \* 50%) in UE5.  
You can set PercentageUnusedShaderCompilingThreads=0 but that might starve your machine, or increase ShaderCompilerCoreCountThreshold to a value \> to your thread count so you keep 3 threads for editor/game tasks.  
Cheers!

---

<div class="post-metadata">

**Author:** ![WickedDecent](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WickedDecent](https://forums.unrealengine.com/u/WickedDecent)\
**Post date:** [June 20, 2022, 11:04pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/5 "2022-06-20T23:04:54Z")

</div>

Any help for a non-coder who is trying to get UE5 shader compiling to load much faster?

I tried the fix posted by @yaoyuh involving the semi colon delete from that one file. It seem to have improved start up a wee bit, but I’m trying to run this on macbooks w MS/HS learners come August and they aren’t going to be able to wait 20+ minutes for compiling to kick in JUST to start up UE5, much less work on a project.

---

<div class="post-metadata">

**Author:** ![christuusgnosis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@christuusgnosis](https://forums.unrealengine.com/u/christuusgnosis)\
**Post date:** [July 4, 2022, 11:10pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/6 "2022-07-04T23:10:54Z")

</div>

after it has compiled the shaders  
you must save the scene for the cached shaders to stick or you wasted time.  
Remove all platforms you aren’t really building for like linux and choose only ogl or vulkan, not both.  
If your ddc is at default, then if your main drive is near full its always going to happen.  
change your ddc to a different drive, it can grow to many gigs

---

<div class="post-metadata">

**Author:** ![That\_guy\_over\_there](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@That\_guy\_over\_there](https://forums.unrealengine.com/u/That_guy_over_there)\
**Post date:** [August 3, 2022, 8:23pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/7 "2022-08-03T20:23:30Z")

</div>

Hello,

The compiling Shaders numbers simply isn’t even going down. So I cannot enter my editor.  
Also, Unreal Engine is using 0% of my CPU, so I’m very stuck.

all the solutions i c everywhere assume something is happening, but for me simply nothing happens.

First time i opened the project I had to w8 0 seconds now it doesn’t even compile 1 shader.  
 ![explorer_e5ezudv8d2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/d/09d42de183e194be25a9b016e297519a52fb75ba.gif)

---

<div class="post-metadata">

**Author:** ![christuusgnosis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@christuusgnosis](https://forums.unrealengine.com/u/christuusgnosis)\
**Post date:** [August 4, 2022, 1:52am UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/8 "2022-08-04T01:52:26Z")

</div>

obvious question  
do other projects still compile or is it any project  
you can also take a clean project and just copy the content folder into it and try that

---

<div class="post-metadata">

**Author:** ![verence333](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@verence333](https://forums.unrealengine.com/u/verence333)\
**Post date:** [September 6, 2022, 5:09pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/9 "2022-09-06T17:09:48Z")

</div>

(Version 5.0.1 in MacBook Pro)

So. A couple of months ago I applied this fix:

> **[UE4 "Compiling Shaders" is super slow](https://realtimevfx.com/t/ue4-compiling-shaders-is-super-slow/3163/24)**
>
> I had this issue but found the solution for it here: Open the file “C:\\Program Files\\Epic Games\\UE\_4.XX\\Engine\\Config\\ConsoleVariables.ini” in any text editor. Find the line “; r.XGEShaderCompile = 0” and remove the “;” at the beginning of the...

And it worked fine, for some time. But some days ago it started to happen again, even though that parameter in ConsoleVariables.ini is still set to 0. I’m not sure why it happened again. It _seems_ it started happening when I opened “UnrealEditor” directly instead of “Epic Games Launcher”, but I can’t see why it might be the reason, and I just don’t have time to discover it by trial and error, so there’s that. I suspect that there must be another cause (e.g. files in the DDC path had an almost zero size and I have no clue about DDC but it doesn’t look right).

Today, I applied this fix as well:

> [@Massively speed up light building and shader compiling! adjust UE4 affinity to LOW](https://forums.unrealengine.com/t/massively-speed-up-light-building-and-shader-compiling-adjust-ue4-affinity-to-low/10055/21):
>
> To set the shader compiler priority to a default value for each compiler instance, we can access the BaseEngine.ini file located in Engine\Config directory. Open the file and search (ctrl + F) for “workerprocesspriority” and set the corresponding priority value to whatever suits your needs: -2 = Low, -1 = Below Normal, 0 = Normal, 1 = Above Normal, 2 = High.

It seemed to help me to compile the shaders a bit faster in the beginning (but not a big deal). It still took me more than 3 hours to 1) open the project and 2) wait until the “Preparing Shaders” step finished.

After my project was finally ready, I saved the scene so the compiled shaders are cached as @christuusgnosis suggested here: [[UE5] Compiling Shaders On Every Startup - #6 by christuusgnosis](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/6)

And then I closed everything and reopened the project. Now it’s working again. I think the only _really_ relevant action I took was just wait until everything is loaded and stable, and then save everything and restart.

I’m not happy about this. It can happen again at any time.

---

<div class="post-metadata">

**Author:** ![christuusgnosis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@christuusgnosis](https://forums.unrealengine.com/u/christuusgnosis)\
**Post date:** [September 6, 2022, 8:12pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/10 "2022-09-06T20:12:33Z")

</div>

You have it.  
make sure the ddc isn’t too small and is set up correctly  
then when you open a new proj  
you walk away for an hour (or sometimes more)  
The UE5 city sample took 3 hours to compile the shaders  
City Park environment takes about 1.5 hours  
but once they ahave completely compiled  
if you save, the build data for the meshes and shaders is saved  
so it should load in minutes after  
unless you change platform settings  
The same applies to building a packaged game  
the first time takes looooong  
and each time you redo it it will go fast as long as you did a build before

---

<div class="post-metadata">

**Author:** ![verence333](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@verence333](https://forums.unrealengine.com/u/verence333)\
**Post date:** [September 7, 2022, 6:20pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/11 "2022-09-07T18:20:23Z")

</div>

Thanks for the reply. I hope it doesn’t happen again. But, if it does, I’ll simply leave the project opening while I’m going to bed.

---

<div class="post-metadata">

**Author:** ![ProteanProds](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ProteanProds](https://forums.unrealengine.com/u/ProteanProds)\
**Post date:** [September 19, 2022, 2:08am UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/12 "2022-09-19T02:08:39Z")

</div>

My guess is aggressive compilation of content in the project’s folders, even when that content is not in any map (possibly due to some kind of bug). Which can be an issue every time the editor (rightfully) decides all the shaders (in the project) need to be recompiled.  
If I understand correctly, the engine [can be reconfigured to use ODSC instead](https://forums.unrealengine.com/t/i-thought-compiling-shaders-on-new-project-wasnt-needed/640293/2).

To do it for all projects, I added to the `[SystemSettings]` section of  
`C:\Program Files\Epic Games\UE_5.0\Engine\Config\Windows\WindowsEngine.ini`:

```auto
[SystemSettings]
...
;Activate ODSC for all projects
r.ShaderCompiler.JobCacheDDC=1

```

Now after creating a new project with starter content, only _150_ or so shaders get compiled! \O/  
And if I put the JobCacheDDC=0 and reopen that project, sure enough a cr\*p-ton of shaders get queued for compilation again.

---

<div class="post-metadata">

**Author:** ![MattDeakin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MattDeakin](https://forums.unrealengine.com/u/MattDeakin)\
**Post date:** [September 23, 2022, 9:24pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/13 "2022-09-23T21:24:34Z")

</div>

I managed to solve the problem by reinstalling UE5 completely and I also moved the cache folders to another drive just in case, the original drive wasn’t full, nowhere near and I don’t know if that helped but thought I’d mention it.

Also sorry for not replying, kind of lost motivation after that issue but picked it up again recently! Thanks for all the suggestions 🙂

---

<div class="post-metadata">

**Author:** ![Marviator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marviator](https://forums.unrealengine.com/u/Marviator)\
**Post date:** [October 27, 2022, 5:02pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/14 "2022-10-27T17:02:15Z")

</div>

Just my 2 Cents…  
I also reinstalled the engine coming from 5.0.2 to 5.0.3 now. This worked!

---

<div class="post-metadata">

**Author:** ![DracFayVamp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DracFayVamp](https://forums.unrealengine.com/u/DracFayVamp)\
**Post date:** [November 4, 2022, 5:05pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/15 "2022-11-04T17:05:56Z")

</div>

I’ll try that. I can’t move constant compiling shaders.

---

<div class="post-metadata">

**Author:** ![IRJayJay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IRJayJay](https://forums.unrealengine.com/u/IRJayJay)\
**Post date:** [December 28, 2022, 8:24pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/17 "2022-12-28T20:24:45Z")

</div>

Ok, this time I really fixed it. Simply deleted the following folder, I’m sure it’ll work for UE5 too:  
C:\Program Files\Epic Games\UE\_4.27\Engine\DerivedDataCache

It’ll compile shaders when you open your project next, but then after that it seems to have cached it, finally.

---

<div class="post-metadata">

**Author:** ![DracFayVamp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DracFayVamp](https://forums.unrealengine.com/u/DracFayVamp)\
**Post date:** [February 8, 2023, 8:11pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/18 "2023-02-08T20:11:54Z")

</div>

this problem is back with the update

---

<div class="post-metadata">

**Author:** ![Benedict\_V](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Benedict\_V](https://forums.unrealengine.com/u/Benedict_V)\
**Post date:** [February 12, 2023, 7:48pm UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/19 "2023-02-12T19:48:04Z")

</div>

These problems seem to happen after updating UE. Instead of updating UE, I uninstall and reinstall it. Packaging a project or compiling shaders that would take no more than 5 minutes would literally take me hours after updating UE with no end in sight.

Uninstalling and reinstalling seems to be the best way to go when there is a new version of UE. I wonder sometimes if it has something to do with installed plugins.

---

<div class="post-metadata">

**Author:** ![AstroManVan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AstroManVan](https://forums.unrealengine.com/u/AstroManVan)\
**Post date:** [February 25, 2023, 5:42am UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/20 "2023-02-25T05:42:53Z")

</div>

Tried a whole bunch of these ideas. This was the one that worked for me.

---

<div class="post-metadata">

**Author:** ![The\_Lapis\_Fox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@The\_Lapis\_Fox](https://forums.unrealengine.com/u/The_Lapis_Fox)\
**Post date:** [March 3, 2023, 8:44am UTC](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971/21 "2023-03-03T08:44:34Z")

</div>

Personally, this is something that could truly make me decide to stick with Unity. I have tried all of the above. I have changed settings in the INI, moved the DDC folder, deleted the DDC folder, reinstalled, deleted ALL of my projects (they were empty blanks ones anyways) and no matter what I do, I have to wait 30+ minutes due to ‘compiling shaders’.

_ **I currently have no projects so please tell me what stupid shaders you are compiling!!!** _

Seriously? 30+ minutes just to open the stupid program so I can select a blank project and have to wait 30+ more minutes? Whoever designed this engine to work this way needs to be shot!

[Next page](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971.md?page=2)
