The UE5 Learning Kit compiling shaders after every launch

Caveat: I’m running UE5.3 on an M1 MAC.

While I can appreciate a nice ready made asset available for users to start from, this kit seems to be a very painful experience. The recompile of the shaders every launch was terrible as well as it taking forever.

What I did to improve this was to set a filter of “Material” type in the Content Drawer and then individually do the following things to each material:

  1. Open in the material editor
  2. Set details filter to “usage” ( this brings up all the details within the usage section )
  3. Toggle off+on / Turn on “Used with Static Lighting” and “Used with Instance Static Meshes”
  4. Save / Apply ( this triggers a shader compile )
  5. Close UE5

The restart time delta was profound. While probably not the correct thing, as there are maybe functional implications, it made the using this pack a possibility.

Dude, you aren’t kidding. Just trying to open the project for the first time and it’s pretty much stuck at 45% on compile shaders. This is almost enough to send me running back to Unity.

TL;DR / Just follow this post:

I found this link on the UnrealEngine forums Shader compilation is slow and do not use available ressources made a massive difference for my 2019 Intel MacBook.

For my 2023 M3 Pro Max MacBook this setting in a post titled Shader compilation is slow and do not use available ressources was helpful.

  • Search your Mac with Spotlight for PercentageUnusedShaderCompilingThreads - for me its in a file at /Users/Shared/Epic Games/UE_5.3/Engine/Config/BaseEngine.ini. I’ve edited mine to look like this:
[DevOptions.Shaders]
; See FShaderCompilingManager for documentation on what these do
bAllowCompilingThroughWorkers=True
bAllowAsynchronousShaderCompiling=True
; Make sure we don't starve loading threads
NumUnusedShaderCompilingThreads=3
; Make sure the game has enough cores available to maintain reasonable performance
NumUnusedShaderCompilingThreadsDuringGame=4
; 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=10
; Batching multiple jobs to reduce file overhead, but not so many that latency of blocking compiles is hurt
MaxShaderJobBatchSize=10
bPromptToRetryFailedShaderCompiles=False
bLogJobCompletionTimes=False
; Only using 10ms of game thread time per frame to process async shader maps
ProcessGameThreadTargetTime=.01
; For regular machines, wait this many seconds before exiting an unused worker (float value)
WorkerTimeToLive=20
; For build machines, wait this many seconds before exiting an unused worker (float value)
BuildWorkerTimeToLive=1200
; Set process priority for ShaderCompileWorker (0 is normal)
WorkerProcessPriority=0

Note the weird interaction / logic with the ShaderCompilerCoreCountThreshold. Its like it uses that value to decide if your machine is a high or low spec machine.

  • Low spec machine - uses NumUnusedShaderCompilingThreads
  • High spec machine - uses PercentageUnusedShaderCompilingThreads

If you have a high spec machine with numberOfCores CPU cores, then it uses some percentage that you set of those cores. Eg my M3 Mac Pro Max has 16 CPU cores which is greater than the 12, so it will use PercentageUnusedShaderCompilingThreads which I have changed from the 50 originally set to 10 so my actual shader thread count would be:

threadsToCreate = numberOfCores * (100 - PercentageUnusedShaderCompilingThreads)

If you have a low spec machine then it ignores the percentage and uses:

threadsToCreate = numberOfCores - NumUnusedShaderCompilingThreads

Privacy & Terms