Shells vs. Masks

When I look at many content examples, I see that it is common to use R, G and B masks to control where a mesh’s material changes to something different. It might change the metallic and other attributes to create the look of entirely different materials in a single mesh. This is fine, but the other way to do this would be to assign different materials (in Maya or whatever your DCC app is) to different “Shells” of a single mesh. a shell is just a collection of polygons, usually created when you merge parts together into a single object. When I import the mesh into UE4, those material shells are kept, and allow you to assign any material to that shell.

My question is… which is better for efficiency? Since the Mask method seems common in the examples, I would think that is more efficient. However logically, I would think the shell method is better. One or more less maps, only the vert/face collection needs to be stored. You can use material instancing more efficiently, since you never have to create a special material to use masks. But perhaps there are advantages to the Mask method I’m overlooking? Since this seems to take more man-hours by a slight amount, why do it?

Thanks for any info!

Andrew

You have to use a multi-sub material setup for your “shell” method. Basically it then boils down to multiple render passes as the shader has to be switched per sub-material. With the masked version you’re simply doing a different blend based on a texture channel value, so the only real cost is the binding of an extra texture or two, in terms of draw calls it doesn’t add any at all. So theoretically the masked version is faster, even though it uses more texture units.

Its not really an either/or though, you can use both setups depending on your needs. I wouldn’t get too bothered by it. Try both out and see what you prefer.

Well, I’m in an optimization phase in my project, so this was of concern to me. Draw calls makes sense, and I should have thought of that. It might make sense for me to simplify some things that way then.