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.
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.
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.
Regarding worker count, UE5 introduced some new settings in BaseEngine.ini: ShaderCompilerCoreCountThreshold and PercentageUnusedShaderCompilingThreads. The documentation is quite self-explanatory:
; Core count threshold. Below this amount will use NumUnusedShaderCompilingThreads. Above this threshold will use PercentageUnusedShaderCompilingThreads when determining the number of cores to reserve.
; 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).
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.
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.
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
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:
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.
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.
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
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.
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:
;Activate ODSC for all projects
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.
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