Fresh UE 4.25.3 install... Is this normal? How can you all stand this?

I’m switching from Unity, and I’ve always heard UE has some pretty crazy build times, but as a full-time C/C++/CUDA engineer myself, I’m not afraid of that. My own commercial project takes 25 minutes to build.

But… this is absolutely ridiculous. I just closed and attempted to re-open one of my projects (small test project, just has a couple cubes, based off First-Person example project), and it’s taking 30-45 minutes to just compile shaders. After only closing and opening a project.

I mean look at this, over 5,000 shaders! From a simple, no-content project! I have maybe 4 materials!

bTjTmlT.png

It’s been doing this for 30 minutes now, at 100% CPU utilization! I just want to work on my project, but I can’t. Can’t even browse the internet because my machine is so bogged down. And I have a 5 Ghz 6-P/12-L core machine, with 32 GB of 3200 Mhz DDR4 memory.

Unity took maybe 2 minutes to load a very complex project. I don’t understand why UE4 is doing this. Why must it completely recompile shaders every time a project is loaded, and why are there thousands of them?

Have I configured something incorrectly? I basically just used the Wizard to create an empty FPS project. How can I prevent UE4 from having to recompile every shader under the sun every time a project is loaded?

It’s awful, I know. Changing one setting in Project Settings that require a restart brings this shader compiling in the thousands to initialize too. I had read, and thought myself too, that it could be all the folders containing materials, textures, and other assets that are in every newly made project…no matter what the project itself contains. So, is the solution to delete / move all those folders from the project to a different folder (such as in the engine’s main program folder so they’re still accessible)? I haven’t tried it yet. Be careful about adding megascans or other material / asset downloads to a project, or it would most likely add to the thousands of shaders, and I think I have encountered that in a past version of UE where starting up a pre-saved project initialized over 20,000 shaders. And I’m using a 5 year old dual core CPU (2 threads each at least) at 2.4 GHz, 6 GB DDR3 RAM (3 of which is usable lol), and it somehow finishes in about 2 hours or so.

That was amazing, but how is it resolved in a new project, or a project with no terrain material / master material / tesselation. I couldn’t tell what program was used to clean / free the RAM. Is there another app for doing that, an app which is free? Is the skysphere using tesselation by default?

On that video they are using this utility to free RAM Razer Cortex - Get better, faster, smoother performance from your PC | Razer United States … but only because the PC they are working on had few RAM available… on the task manager you can see UE4 taking 4.7GB which is stated at 72% of all available RAM. That is the reason why they needed to use an utility to free some RAM. It is not needed otherwise.

I could probably use it functionally on the laptop I’m using. One other possible solution to the compiling shaders is to clean cache, defrag hard drive, stop unnecessary processes in the background, don’t use any other programs while running UE or use a minimum of 1 other program too, and potentially move all the folders containing starter content and other assets that are not currently part of the project to a folder separate from the project folder. I really think it is compiling shaders for materials, models, and other assets that are not used in the project, as a preset measure to prepare the engine to render those if they’re placed in the scene. I never encountered that problem of thousands of shaders compiling suddenly in Unity or CryEngine, particularly from starting a new project or opening an existing one and when there’s not much in the level / scene. A request to change that has already gotten proposed, I’m certain. It should be a top priority for fixing. I bet lots of users have dropped the engine in favor of a more efficient application and workflow.

Is there a custom source build for 4.25 where shader compiling is minimal to none? Let’s say you have to strip out all static lighting and light baking features, so what you’re left with is a fully dynamic lighting setup. That would be acceptable. I’ve always thought that generating lightmap cache results in the user downloading needless amounts of data when more optimal lighting methods could remove that requirement entirely. I’m also curious as to how UE5 will perform in this regard. Do we have to compile and store vast amounts of cache data for the engine to “stream” textures and polygons to the user?

I guess I’m used to compiling shaders but this really sounds like something is wrong. When I am recompiling shaders I typically just minimize UE4 and browse the internet, and its done within 10 minutes in a starter project. I can also just work without issue on the project in areas like Blueprints that don’t require material display. My system never gets so bogged down that I can’t do anything… For reference I am on an i7-6700k.

For complete projects it definitely takes a while but it depends on the amount of content you have but there are ways to optimize your shader permutation for your project.

As for why an empty project has 5k shaders, I believe this is just the engine content. Even without the starter content, there are still shaders that the engine needs to build. This should only need to be done once per project when you load it the first time or after an engine update so it is not something that should happen every time you load a project.