# \[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:** 1\
**Showing post:** 9

<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.

---

_[View the full topic](https://forums.unrealengine.com/t/ue5-compiling-shaders-on-every-startup/520971)._
