Shaders keep compiling endlessly
I haven't converted my project yet to 12, but considering this problem existed in all prior versions I assume it's still there.
The problem I have is Compiling. Compiling, and more compiling. It starts when I open any level I made (especially when the level has a terrain or foliage in it) UE4 needs to compile about 5000 - 8000 shaders and takes roughly an hour before it's done doing so. In the meantime, the scene is rendered useless because all objects are gray and the lighting looks off so I can only start working after this has been completed.
Then it becomes more annoying when I am finally able to paint on any landscape I made. Every time I paint a new layer on a new terrain tile, it again needs to compile about 400 - 1500 shaders. Taking about 10 minutes per layer and while it's doing so, the tile I'm painting on is again rendered gray until the compiling is done. These tiles are about 10 x 10 meters if not smaller and I'm working on a terrain with the size of about 2 x 2 kilometers. That means if I wanted to paint just one layer on the entire terrain I need to wait more than 600 hours, or almost a month. And then I have about 8 layers. I can watch my kids grow by the time the compiling is done, and I don't even have kids.
So about 80% of my time spent in the UE4 editor is wasted on waiting for shaders to compile. It really ruins the workflow not to mention my motivation or creativity and I doubt other people are fine developing this way.
Does anyone know what I'm doing wrong here? I'm using the Landscape AutoMaterial asset for most painting and my scenes aren't that complex. The issue extends to regular terrain painting as well and foliage assets. I figure there must be some way to have all shaders compile just one time and not after every single change or load.
I already contacted the author of the LAM asset but the conclusion was that it was normal. How could one properly design a terrain with so many interruptions?
Any help is really appreciated.
asked Aug 23 '16 at 11:48 AM in Rendering
You should not have a shader recompile on every load or edit. Landscape recompile will happen when you add or remove a layer from terrain component and only if there is no corresponding shader variation exists for given layer combination. Landscape shader compile times will grow significantly with every terrain layer you have in material. From my experience, anything above 12 is impractical in terms of editing terrain. I haven't worked with LAM, but i'd expect its shaders initial compile to take roughly 10-15 minutes on medium hardware. As a side note, enabling tessellation on landscape materials seems to increase compile times roughly by a factor of 2, for me at least.
But yeah, as I said, you should not have any kind of recompile when loading map. Ensure that nothing is stopping UE4 to properly save Derived Data Cache. It could be the reason why you are getting recompiles on every load.
answered Sep 06 '16 at 09:29 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here