Friday, July 13, 2012

UE3 Performance Analysis: Material IDs vs. Vertex Blending

I was always wondering how much multiple materials on a mesh will affect the performance. Theory says that each mesh/material combination will cause an extra draw call and due to common opinion you should always keep the amount of material as low as possible.
So as an alternative I thought of using vertex colors to blend between multiple textures on a single mesh with just a single material.


For the test I'm using a timber frame house model (4448 tris) with 6 materials in total. This model is beeing placed 37 times in a simple level. The lighting is prebaked. To blend 6 textures by vertex colors in a single material this method is being used: http://oliverm-h.blogspot.de/2012/02/how-to-use-vertex-colors-to-blend.html
Here's the performance stats:

 Multiple Materials


Vertex Color Blending



Those screens show a clear result. Though multiple materials causes the draw call count to be 3.75 times higher (750 / 200), FPS are still better. The vertex color material complexity is probably killing the advantage of less draw calls. Also the Unreal Engine seems to handle many objects (and therefore draw calls) quite well.

2 comments:

  1. wow good test, thank you! though you seem to be right concerning the material complexity, working with it might be difficult and perhaps the shader might also very expensive?

    ReplyDelete
  2. Hi Sascha, I have also done tests with just 3-4 textures/materials, the result is pretty much the same. It's probably the vertex color blending itself that causes a certain performance impact. So it's probably always better to use multiple materials or mesh parts, as long as you don't need smooth texture transitions of course.

    I'll make another test for texture mask blending and add this to the comparison soon.

    ReplyDelete