Download

Material Layers Optimization

Hey!
Im started on a project and want to set up a good foundation for the Material Layer system, but i can’t find much information about it. One performance question i have is:

What is the best (in terms of performance) way of doing the Material Layer Blends?
A library of smaller restricted Layers Blends, so you choose what Layer Blend you want to use for your specific case. OR is it better to have a “Master” Layer Blends that contains a lot of different blend methods and take advantage of switches, so you always use the same Blend Layer no matter how you want to blend?

If someone has an answer or just a hunch of what probably would be the best way to go id be grateful!

I hope somebody else can pitch in here. I jumped into it a while a go but then abandoned it. The library of layer blends seemed like the way to go. But it was frustrating because there seemed to be no way to measure the performance… In the epic videos they say that it only compiles the necessary nodes in the final material but in the shader stats it jumps up really high to like 16 Texture Samples/Lookups with just one lightweight layer. And in the shader optimization viewmode it seems to just display the same dark green color regardless of complexity. To me it just ended up being faster to just alter an existing material and use instances than to try and do everything with a bunch of premade bend nodes. If you make a bunch of nodes at the beginning of a production you are kind of locked into that bc if you want to alter anything it will change all the already existing materials and it just got really confusing

I would try 2d texture array for storing textures and store blend info in vertex color. This is how is it done in AAA games, you can easily texture walls in whole town with one array (material). If I remember well, Witcher 3 was using this technique quite a lot. Also it is probably only way how to do performant multilayer terrain material. But I am not sure, how far is UE with this. I ve seen tool for 2d texture array creation in 5.0EA, but never tried.