# Easy way to force Compile all Shaders?

**URL:** <https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386>\
**Category:** Asset Creation\
**Tags:** unreal-engine\
**Created:** [May 4, 2017, 8:51pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386 "2017-05-04T20:51:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shurkuris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shurkuris](https://forums.unrealengine.com/u/Shurkuris)\
**Post date:** [May 4, 2017, 8:51pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/1 "2017-05-04T20:51:31Z")

</div>

So, for…

UE4  
4.15.2  
MacOS.

Is their an easy way to force an entire folder or the editor to compile all shaders? I want to do some Level Design work (With the Infinity Icelands pack) but, I’m spending way to much of my time waiting on the Editor slowly compiling shaders every time I want to look at a Mesh.

**(1) How can I force UE4 to compile all shaders at once, so I can wait for X time for to it ALL to compile, so I can just worry about my Art.**

Regards,

Eric

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_923c79df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_923c79df](https://forums.unrealengine.com/u/anonymous_user_923c79df)\
**Post date:** [May 4, 2017, 8:55pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/2 "2017-05-04T20:55:15Z")

</div>

Deleting your DerivedDataCache folder of your project should force the editor to compile -\> [https://forums.unrealengine/showthread.php?1612-How-to-Force-Shader-recompile-of-everything-like-the-first-time-you-run-the-engine](https://forums.unrealengine/showthread.php?1612-How-to-Force-Shader-recompile-of-everything-like-the-first-time-you-run-the-engine)

[https://docs.unrealengine/latest/INT/Programming/Rendering/ShaderDevelopment/index.html](https://docs.unrealengine/latest/INT/Programming/Rendering/ShaderDevelopment/index.html)

* * *

Shader caching and cooking

Once shaders are compiled, they are stored in the Derived Data Cache. They contain, in their key, a hash of all the inputs to the compile, including shader source files. That means that changes to shader source files are automatically picked up every time you re-launch the engine or do a ‘recompileshaders changed’.

When you are modifying FShader Serialize functions, there is no need to handle backward compatibility, just add a space to a shader file that is included by that shader.

When cooking assets, material shaders are inlined into the material’s package, and global shaders are stored seperately in a global shader file which allows them to be loaded early in the engine startup.

---

<div class="post-metadata">

**Author:** ![Shurkuris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shurkuris](https://forums.unrealengine.com/u/Shurkuris)\
**Post date:** [May 4, 2017, 9:47pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/3 "2017-05-04T21:47:14Z")

</div>

The only “ **DerivedDataCache** ” folder I can find is in my…  
_HDD \> Users \> Shared \> Epic Games \> UE\_4.15 \> Engine_  
Deleting that did force UE4 to compile “some” shaders, but not the ones I wanted in my Infinity Icelands pack, as the Static Meshes still need their shaders compiled.

Going to my project folder…  
_HDD \> Users \> MyUserName \> Documents \> Unreal Projects \> LevelDesign\_01_  
Shows no “DerivedDataCache”…

Looking on google for where the heck this folder is located is also very vague. Am I deleting the correct folder?

---

<div class="post-metadata">

**Author:** ![cyaoeu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cyaoeu](https://forums.unrealengine.com/u/cyaoeu)\
**Post date:** [May 5, 2017, 10:35am UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/6 "2017-05-05T10:35:34Z")

</div>

You can put all of the meshes in the level (or some level) and UE4 should compile shaders for all of them.

---

<div class="post-metadata">

**Author:** ![Observer64](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Observer64](https://forums.unrealengine.com/u/Observer64)\
**Post date:** [March 29, 2018, 6:25pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/7 "2018-03-29T18:25:30Z")

</div>

Looks like the answer is:

“You can fill your DDCs at any time by running the following command:  
UE4\Engine\Binaries\Win64\UE4Editor.exe ProjectName -run=DerivedDataCache -fill  
Epic Games does this on a nightly basis to ensure that the DDC is always primed”

That is not merely shaders though but all derived data, regardless a ‘primed’ DDC should ensure that editor load times are unhindered.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0c668f62](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0c668f62](https://forums.unrealengine.com/u/anonymous_user_0c668f62)\
**Post date:** [April 7, 2018, 10:15pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/8 "2018-04-07T22:15:32Z")

</div>

I know this is old but just in case you want to do what OP asked: just use content browser in UE4, go to the folder, select all meshes and press right click. Wait for it to finish and the shaders will be compiled. This is the same as dragging all of them to the scene, as cyaoeu said, but I guess easier so you don’t have to delete them later (and easier if you have dynamic lightning and such)

---

<div class="post-metadata">

**Author:** ![corintho](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@corintho](https://forums.unrealengine.com/u/corintho)\
**Post date:** [August 2, 2022, 1:20am UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/10 "2022-08-02T01:20:07Z")

</div>

This is great. I also used the filters to select all "Material"s, and it compiled a few other shaders. Probably ones used by particles systems and other things not related to meshes.

---

<div class="post-metadata">

**Author:** ![Thik101](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thik101/32/581907_2.png) [@Thik101](https://forums.unrealengine.com/u/Thik101)\
**Post date:** [October 10, 2022, 2:53pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/11 "2022-10-10T14:53:16Z")

</div>

Ho yeah, right on my friend. All fixed now! I can’t believe I did not think about that haha. So use to open the demo map for project that I forget about this.

Thanks

---

<div class="post-metadata">

**Author:** ![JerzMcDerz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JerzMcDerz](https://forums.unrealengine.com/u/JerzMcDerz)\
**Post date:** [July 19, 2023, 1:23pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/12 "2023-07-19T13:23:27Z")

</div>

Not sure what works or doesn’t anymore. The rebuild of DDC didn’t help me with rebuilding shaders for running in a “standalone game”, and that cache doesn’t seem to stay after you close the window. What worked for me was filtering at the “All” folder level for “material”, then selecting all materials, right clicking on them and selecting save. It builds shaders for each one as it saves them.

I also tried: r.ShaderCompiler.JobCacheDDC=1  
I thought it worked once, but then I was right back to 12k shaders compiling, so not sure what happened. But the right click and save thing seems to be working so far.

---

<div class="post-metadata">

**Author:** ![Lukash3k1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lukash3k1](https://forums.unrealengine.com/u/Lukash3k1)\
**Post date:** [January 28, 2024, 5:52pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/13 "2024-01-28T17:52:17Z")

</div>

**[Solution]**

1. Click on **content folder** in content browser.
2. Turn on **filters** for: Materials, static mesh, niagara effect, textures.
3. Select all with **Ctrl+A**
4. **Right Click** → Now compiling start.
5. **Done.**

I just add few big project with assets, and now compile everything at once. Thanks! 😀

---

<div class="post-metadata">

**Author:** ![TON14](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TON14](https://forums.unrealengine.com/u/TON14)\
**Post date:** [January 3, 2025, 5:25pm UTC](https://forums.unrealengine.com/t/easy-way-to-force-compile-all-shaders/91386/14 "2025-01-03T17:25:18Z")

</div>

use command  
**recompileshaders all**
