No announcement yet.

Easy way to force Compile all Shaders?

  • Filter
  • Time
  • Show
Clear All
new posts

    Easy way to force Compile all Shaders?

    So, for...


    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.



    Deleting your DerivedDataCache folder of your project should force the editor to compile ->


    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.


      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?


        Originally posted by Shurkuris View Post
        The only "DerivedDataCache" folder I can find is in
        DerivedDataCache often resides within each project folder itself, and also here too:


        More info:

        Originally posted by Shurkuris View Post
        Looking on google for where the heck this folder is located is also very vague.
        Googhoul is the king when it comes to personal info slurping, but it doesn't have all the answers.....
        There's always other search options including: 'these forums' / Startpage / DuckDuckGo / Qwant...


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


            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.


              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)