How expensive is it to use 2-3 material slots per mesh? Should I bake all of my textures to UV maps instead?

So basically I love material slots and I use 2-3 of them on many of my meshes, even though the extra draw calls are bad for performance. Am I in trouble? For my workflow I love that material slots give me flexibility to easily mix and match the materials I created in UEFN, and play with the tiling/UVs, all inside of UEFN, without shuffling my mesh around between external programs. I can easily recycle the same mesh many times in my map, by swapping out the materials in its slots.

However, because each material slot costs an extra draw call, so should I transition my workflow away from material slots, and start baking textures into UV maps? Or is there something I can do to mitigate the draw call cost? Almost all of my materials are Instances of just a few Master Materials, if that helps. Also, if I were to make a materials tutorial that mentions the Material Edit tool, should I tell creators to avoid adding material slots?

Because my meshes that use slots usually only have 2 slots or sometimes 3, I thought I was probably safe. I notice that some of Epic’s own FN meshes include 2 or 3 material slots. I never use, like, 20 slots or anything.

Here is an example of how I’m using material slots. The tree and each of my potted plants contains 2 slots, and the window has 3. All three potted plants recycle the same mesh, with different materials. The scale of all of these props is huge and the player is tiny - as you can see by the scale of the mannequin I circled. So if you count up all of the material slots being used in this large scene across all of the meshes combined, including walls/floor it’s about 15.

Basically I really hope 2-3 material slots is okay because it works extremely well for me as a workflow/artstyle :laughing: Or if it’s not okay, is there a way I can tweak it without needing a complete overhaul? I could probably stick to 2 instead of 3. Honestly it would be kinda nice to use more than 3 but maybe I shouldn’t push my luck.

2 Likes

It’s good to be concerned about performance like this, yet I would not suggest being overly concerned about this unless you encounter performance issues. In your case here having more than one draw call would seem pretty unavoidable, I believe, because they should be using different shading models. The walls and pots should be using opaque materials, whereas the window and leaves would require masked/transparent shading.

1 Like

Thanks, good to know! Performance issues in general are kind of overwhelming to me, so sometimes I feel an impulse to be conservative just in case. I do have a mix of masked, additive, and opaque materials in that image. Also my foliage material has wind on it, which the pot material does not.

I haven’t noticed any performance issues so far, with my meshes. I was more worried about developing bad habits for later. :eyes: And in terms of tutorials, I didn’t want to pass along bad habits to others. :blue_heart: