So if you’re here, I’m going to take a lucky guess and say you feel shader compilation is slow and you want to speed it up.

Well, I’m happy to say that you’re in luck! Speeding up the Shader Compiler is as easy as changing one number, seriously, ONE NUMBER!

Nearly 5,000 shaders? That could take more than a few minutes on a lot of machines!

I’ve had this “problem” a few times, I put “problem” in quotes as its actually a feature of the engine! One of the most demanding things is compiling shaders so Shader Compiler is set up to run at a lower priority so it doesn’t cause issues with anything else, causing other programs to lag or freeze.

Before we get into it; I wouldn’t recommend doing this on a low spec system due to the mentioned reasons. Also; it’s only possible on the source version of the engine.

Before I begin, I should mention that I’m doing this on Ubuntu however Windows is the exact same process. I’m not even sure if this does anything on Linux.

1) First of all, if you haven’t already, get the source version of the engine. Follow the guide here if you haven’t done that yet. [Compiling Unreal Engine 4 From Source]

2) Open the Unreal Engine folder and go to:

Engine/Source/Runtime/Engine/Private/ShaderCompiler

3) Open ShaderCompiler.cpp in your favourite text editor, for now, I’m using the default text editor in Ubuntu, and search for “PriorityModifier”.

4) As you can see; its set to -1 which is below normal. Increase that to “above normal” which would be 1.

You can set it higher or lower depending on your system performance.

And that’s it! Just build the engine again and see a massive improvement in shader compile times. Remember that performance gains will vary from machine to machine. I saw an insane improvement on my main development machine, nearly cutting shader compilation times in half!


2 Comments

Compiling Unreal Engine 4 from source on Windows and Linux | Rhyce Smith · 16 May 2021 at 12:53 am

[…] I would suggest doing now is going over to my other post on speeding up the shader compile times. This requires a source built version of the engine so, why […]

A site update and how you can help. | Rhyce Smith · 24 May 2021 at 4:58 am

[…] checking my analytics and the site is doing pretty well. The most popular post was originally “Improving UE4 Shader Compile Times” but that’s now been overtaken by “Enable OpenGL, and disable Vulkan, in Unreal Engine […]

Comments are closed.