Feature request: Please boost the shader compiler 10 times faster, waiting it in UE5.

Hi, it will be a big leap (big jump) if the compiling time in Unreal Engine is boosted. In the past, I thought that D3DX11CompileFromFile()'s compilation time which is very slow is the limitation of DirectX. But once I discovered that Visual Studio can compile an HLSL, 10 times faster then I believe that Unreal Engine can do the same thing in the future. Can someone reports this feature request please?

– Visual Studio 2015 compiler:
It took less than 5 seconds to compile my HLSL with the internal compiler of Visual Studio 2015, the HLSL is compiled into “.cso”.

– D3DX11CompileFromFile():
It took 40 seconds to compile my HLSL file with D3DX11CompileFromFile()
D3DX11CompileFromFile(L"ComputeShader.hlsl", nullptr, nullptr, “main”, “cs_5_0”, shaderFlags, 0, nullptr, &blob, nullptr, nullptr);

1 Like

Unreal doesnt compile a single HLSL file when you create a material.
Every Material is a collection of different shaders.
your Project’s Rendering Settings dictate how many shader permutations a material has

I know Unreal compiles multiple HLSL files, I’m a developer. There exists an other software that compiles its materials instantly in 1 second, it’s Blender 2.8, it’s a real time rendering with interactive materials (Node Editor). Please make the same thing with Unreal Engine 5. … Blender 2.8 is an Open Source, you can see the source code just to know what did they do to achieve such technique. … The technique doesn’t exist in older version Blender 2.79

And my suggestion is to add an option about compile the material with high optimization that takes more time to compile for the final that needs performance.

@mandaxyz - if you are realy a ‘developer’ - you know why UE4 compiles so many permutations, and you realy see benefit of them on weaker HW. Sure you could have one big uber-shader generated from your material and replace all those static bools / switches with static branching, but then the runtime cost of shader execution will be higher / registers allocation inside generated assembly will be sub-optimal. Runtime cost is all that matters - players expect highest possible performance, they don’t care how much the developer will wait for package building / shaders authoring outcome.
Anyway you could always boost your shader compilation speed by using IncrediBuild and distributing the workload on many machines :smiley:

I really loved how Visual Studio 2015 internal compiler compiles an HLSL very very fast in only 3 seconds instead of 40 seconds.
Being a developer (game developer), it’s very painful to wait the compiling time, for example in the past, Visual Studio didn’t compile the HLSL, but I had to manually compile them with D3DX11CompileFromFile() and it takes about 40 seconds. And same thing for Unreal Engine 4, I believe that it uses D3DX11CompileFromFile().
I’m talking about HLSL because Material Nodes are transformed into codes as HLSL then compiled.

So, is it possible to contact Microsoft in order to get the source code on how to compile any HLSL very very fast? The creator of Blender contacted Autodesk then he is allowed to use FBX file even if it has limited license. The creator of the Open Source Blender said that Autodesk is his friend.

I think the biggest problem is that UE4 waits for all of a material’s shader permutations to compile before displaying any of it. It should prioritize the permutations that are actually needed for the current context and show them as they get ready.

This and also inform developer when all shaders required for current context are done. Maybe some kind of indicator/separate counter in Compiling Shaders overlay.

Shader compilation is one the biggest UE4 devs problem. It takes age, especialy when using a complex shader for landscape that has to be recompiled every time you paint a landscape component. It’s an incredible waste of time, even with really high CPU/GPU. Iteration time should be the first priority of a game engine

I use an Intel i7 (2.4 GHz dual core, 2 threads each) 5500U cpu + integrated graphics card. I notice Blender 2.8 is faster than UE 4.23 in compiling basic shaders for materials in a preview pane. And that’s on mostly High settings in UE 4.23, not EPIC or lower. I have to press Apply to speed it up, otherwise it’ll be a minute and more every subsequent change I make. I’m simply trying to learn most of the basics using this computer and see what it is capable of…and UE 4.23 is quite slow compared to Blender, even on lower spec hardware.

Im also weary of compile times , i5-3570 gtx 950 2gb , but honestly and not to be argumentative here, doesn’t UE use a lot more resources than blender, besides I’m not sure if this applies or adds to threads concerns, but for me,and my system is far from an old crawler blender ‘viewport’ is unusble if you want to work on a few MIL tri’s in edit mode, too slow, crawls to a stop. Reason I bring this up, its affecting tons of users, and it has its own thead at blenderartists , is I’m not sure given that fact and there is faik no ETA on fixing that, I cant see blender being used as a good yardstick for performance comparisons.

In general and this doesnt relate AS much to blender for reasons stated above, UE will crawl w/o top end system and plenty of ram, and of course,those posting here, is your project as complex as mine or more so ?

Doesn’t that play into slowness of material compile ?
The more cores/theads you can throw at code/material compile allegedly ( I can’t test until I get my new ryzen 5 system to know HOW much ) the faster you likely are going to see things happen.
Performance Notes
This list represents a typical system used at Epic, providing a reasonable guideline for developing games with Unreal Engine 4:

  • Windows 10 64-bit
  • 64 GB RAM
  • 256 GB SSD (OS Drive)
  • 2 TB SSD (Data Drive)
  • NVIDIA GeForce GTX 970
  • Xoreax Incredibuild (Dev Tools Package)
  • Six-Core Xeon E5-2643 @ 3.4GHz

More ram the better,and ofc fastest GPU you can handle, fastest of everything is all devs dream, but system above would be incredible UNLESS for raytracing builds,and faik minimum gpu on that i gtx 1050Ti but verify before you buy.

My dev time is crazy given I wait sevral seconds just to see player start on terrain etc.,but oh well system speed is the enemy of nearly all of us, and ofc compile time on code &/or materials, etal.