How much do materials impact performance?

If I’ve got an actor with 20000 polygons and I create 10 uv channels for 10 different materials how much does that impact performance if I had instead only used 5 materials?

Are there certain settings that are good for large scenes or some that aren’t (specular, metallic etc.)? I’m going to have roughly 300 moving actors all between 200-30,000 polygons and want to optimize the settings before applying the UVs and materials.

Each material adds another draw call to that object, so ideally you would only have one material per object.
Most likely you don’t actually need that many materials on a single object

I don’t understand. Why would you only need one material? How would it then be possible to blend different colors together?

This asset here

has gold around the engines, blue as the main color, black streaks, grey highlights and silver up front by the nose. How could you get that with only one material? (I’m not going to use that asset just an example)

This model here is the exact look I’m going for with simple but clearly different color

I see atleast 5 materials, but maybe I’m missing something.

Depending on how complex the thing is you might split it up into multiple pieces, take for instance a character, usually the head is separate and has its own texture.

But also it’s not complicated to make a material that can have several types of things in it–like clothing that has fabric, leather, and metal parts. You just have to create your textures correctly, that’s what the slots are for–diffuse, specular, roughness, metallic. You can change those values in your textures to get different materials within a single material.

You do this by first laying our your models UV’s all on the same UV channel, and then you paint the various areas the different colors. Here is an example of a character UV layout I pull from the web.

If you look at her arm on the UV layout, for example, you could paint that section to look like skin and then paint her legs to look like cloth. This way you could have one Texture with multiple objects and colors in it. To get different levels of reflection or even to add metal objects you should look into RGB masking. You can read more about how to do this from the following doc.

Please let me know if that helps or if you have any more questions.

Cheers-

Sam Deiter

1 Like

I’ve used the metallic, specular and roughness plenty on many objects. But each material only has one slot for each. How exactly can I change the materials within a single material?

You might want to check out Layered Materials as they sound like they do what you want. You can read more about this using the following link.

But note that layered materials increase the draw call for each material that you use as well, and has some overhead due to having to blend them together, it’s just more straightforward to use layers but it’s worse on performance.

That’s why you can make texture maps for each of those slots so that you can make certain parts look like metal or whatever

This kind of makes sense. The key point in this is I just want to set the UVs in Blender then apply all the materials and textures in Unreal so I can see the difference in the game between edits.

If I understand correctly a normal map is used as the UV map at each point in the blend so in essence it’s multiple blends that multiply a normal map by the desired texture at certain points in the UV and then adds them all together? Do I have to set the colors in Blender or can I just set up the UVs there? Then where do I get the Normal maps to blend with the material properties?

It seems way more complicated than having 4 different materials in different places but if it drastically improves performance I’ll try it because the game requires optimization. I’m finding this part of the game making process by far the most complicated, AI pathfinding and physics pale in comparison.

Thanks for the help.

UV’s are the coordinates for the texture map, they define how to map a 2D texture to a 3D model.
Normal maps are a type of texture map that change the direction a surface is facing, they do a similar effect as a Bump map, but in a game engine they render faster than a bump map.
You would have a normal map for the mesh that creates your small details (like scratches and dents)

You would do your UV mapping in Blender, and then use some kind of texturing tool to create your texture maps, I believe Blender has some tools to do texture painting, but you can use many programs like Photoshop, though something like Substance Painter is best for this. For example, in Substance you can take your model and then set what materials you want parts to be (or even paint where you want a material to be) and then it can output texture maps for UE4.

UE4 does not texture your model, you just have to make a material and plug in your textures and then apply that to your mesh.

I’m definitely missing something here Viper. I thought adding the texture sample images in the UE4 materials is texturing the material? When I have an asset in Blender it never actually moves images or textures but transports empty materials that correlate to the UV that allow to set up colors from there.

Are there multiple uses for the word texture that I’m misunderstanding? I understood texture to be the texture sample like I used in this set up( that makes the ship look really cool). It’s only one material but it’s a small ship and I’m looking to add multiple different colors.

I am not sure if you are talking about something else and just used Normal maps by mistake, but what you just described is not how Normal maps work. Normal maps (at a very high level) are used to display small to medium sized detials in 3D meshes that would otherwise be too costly to display while the game is running due to the amount of triangles it would take to show that detail off. Normals maps are essentially storing the offset that light should use when it is cast over the object. You can create Normal maps by projecting the high poly model information on to the low poly model in a DCC like 3Ds Max or Blender.

Hi Mike,
In your mind are the Metallic, Specular, and Roughness pins are just a single value for all of the material? I think this might be where your confused. You can map them to different values all within the same material. Here is a simple example I put together.

TestMaterial.png

I said normal maps only because I saw the blue normal map looking images in the material blend examples you showed where the layer has normals plugged in https://docs.unrealengine.com/latest/images/Engine/Rendering/Materials/HowTo/Masking/TM_Red_Channel.jpg

I don’t really know this stuff at all so I’m just kind of guessing and hoping for as concise feedback as possible. Like an ambitious yet incredibly lost little birdy looking for guidance.

Yeah I figured the material properties were applied linearly but apparently not. This just went from kind of tough to there goes my weekend.

FYI - If you want to apply multiple materials to the same object, you can use a tool like substance painter to generate a single set of textures to use. It will let you paint parts of your model gold, rusted, glass, etc… and export them as a single texture set. It will also pack your Roughness, Metallic, Ambient Occlusion into single texture.

This enables you to sue a single material with only 3 textures for your object and it will perform better than using a layered material.

Note - this also means one material per model - so it is best used for hero models.

A layered approach works good when you have a ton aof assets that share the same materials. e.g. environment stuff likes walls rocks roads etc…

not only just “there goes your weekend” but possibly more like “there goes a month”

In that example, you could plug in your Texture Sample into the Metallic slot and the parts that are white would be metallic and the parts that are black would not be metallic. You could also use that map to adjust the color of those areas. That way, you get different materials within a single material, rather than making a completely separate material file for each material.

FYI - just stumbled across a good summary in the docs:
“Your first impulse may be to use Layered Materials any time you wish to have multiple surface types on an object. For instance, if you have a model of a car, you may want to have one Material Layer for paint, another for steel, for rubber, for glass, etc. However, many of those Materials could be separated at the geometry level. This creates more Material Elements on your objects, which increases draw calls, but is generally much more efficient. In short, if you can apply multiple Materials instead of using a Layered Material, then do so. If you must have per-pixel control over where Materials are placed, then use a Layered Material.”