Save Compiled Eevee Shaders to Disk
Eevee shaders take very long time to compile even on machines with top-notch CPU/GPUs, and the compiling process up till now still seems single-threaded. When you have a complicated scene reopen, you have to wait for each and every shader to recompile.
As far as I know, Eevee is something just like Unreal's realtime material system, so I guess Eevee's compiled shaders should be quite serializable as well. Maybe not saving shaders will save a huge lot of storage space? But the time loss is also rather big. And judging from UE4's cache size, I'll say its disk usage is totally acceptable.
So I suggest that for the least, an option should be given, that whether the user wants to save the shader cache embedded or externally as a folder, or they just don't care to recompile on each reopen (anyone? :P).
7 Comments
Read this article about the future updates for Eevee : code.blender.org/2021/06/eevees-future/ There is a section for "New shader execution model" that tackle it {attachment eeveeShadersExecutionModelPNG}
And actually Eevee and Unreal are really different since Unreal is a game engine and Eevee is a render engine, you have a real time feedback but not real time rendering technically speaking. I dont know well Unreal but I guess they are cheating a lot to handle their materials in real time like baking or something which Eevee does not
* @Shimoon * More precisely, Unreal is a game engine that includes a render engine which is very different from Cycles but uses more or less a similar set of principals as Eevee. The major difference between the two [render engines] might be that Unreal's has to sacrifice more quality to ensure true real time rendering. And let's say that the two render engines may be very differently implemented under the hood, one fact still stands that they both pre-calculate a lot before actual render, and that calculation result, whatever form it takes, can be cached to disk. I'm not quite sure what does "many BSDF nodes" mean exactly in the quote above, does it mean only the BSDF shader nodes or everything include math, noise, ramp, etc.? It will be great too if the general performance of Eevee compilation is improved.
* @Shimoon * Unreal isn't baking anything out (besides Lightmass baked Lightmaps if you use them). The GPU shaders are precalculated like Blender does it but with all CPU cores and then SAVED into the project so it don't need to compile it again on every start. If I had 20000 to 40000 shader to compile in my smallish Blender projects like in my huge Unreal projects on every start I would have shot myself before using Blender again. And the Unreal 4 realtime engine is faster with more features. Unreal 5 is on the next level with insane polygon count (Nanite). insane soft shadows (Virtual Shadomaps), insane texture resolutions (Virtual textures, UE4 has it too) and of cause realtime GI Lumen. But they are a multi Billion $ company with otherworldly resources and skill.
* @Shimoon * This sounds like a more intelligent Shader compiler only compiling the nodes really used in a node graph. There is no mention about caching shaders over sessions.
* @wmysilly *
i guess its something more or less like this: instead of this
I'm pretty sure it got worse with the 2.93 update as well, so something like this is definitely needed
Yes, cache is recomended for this, hvr.. can be issues betwen graphic cards I think.