About compile times, I’ve been looking into ways to improve them.
We know where the compile times slowdowns are coming from.
It mainly comes for lighting evaluation, so Dithered materials are not affected (they’re actually faster than in EEVEE Legacy).
But Blended materials, materials that use ShaderToRGB, and some engine internal shaders are quite slow to compile.
The problem is that we can’t “fix” the compile times without impacting runtime render performance negatively.
So I’ve been looking into other ways to improve the issue.
For materials, we’ve already shipped a patch that reduces the number of compiled shaders required.
The other option I’ve been looking into is doing multithreaded shader compilation.
There’s an OpenGL extension for that, but the support for it is quite spotty, to say the least.
Here’s a WIP build with multithreaded shader compilation (only for materials).
I would appreciate it if you could give it a try and post your timings (and OS+GPU):
(More details here)
To actually measure the materials compile time difference you should delete your shader cache before opening Blender.
On Windows+Nvidia it’s on %LocalAppData%\NVIDIA\GLCache
.
On my machine (Nvidia) it can make material compilation up to twice as fast, but it’s quite dependent on the scene.
However, we’ve seen that in some drivers it can make things slower because multithreaded compilation is not actually supported even if it’s reported as so.
I’ve already had to disable the feature on Mesa drivers for that reason.
There’s another potential route we could take for multithreaded compilation (spawning subprocesses), that at least on simple tests can yield much better results and doesn’t rely on any OpenGL extension.
But that would be way more complex and it may not be too realistic to get it ready for 4.2.
Would it be possible that for the launch of EEVEE Next at least some feedback is being given to the user a la Unreal style? like initialisizing (percentage) and compiling shaders (x of n)? at least until improvements are done.
If I got it right, Initializing time is high but it only happens once when you are running EEVEE Next for the first time
Yes, I have another PR ready that does pretty much that:
And yes, you’re right that this is an issue only the first time you run EEVEE Next for a given Blender version (and the same for materials), since after that the shaders should be cached by the driver.