Couple of questions regarding optimization, primarily draw calls

Hi guys,

  1. Draw calls vs texture res, what to go for?
    For example, a mesh with 3 materials, each material is a 1k texture. Or a mesh with 1 material but 2k map. Would it be the same case if 3 materials and 2k textures, vs 1 material and 4k texture?

  2. LODs: Having multiple LODs = more draw calls? If I have a mesh with 3 material elements, and 1 LOD, is that 8 draw calls? If it’s 8, how are LODs contributing to optimization?

  3. Does the command “stat scenerendering” shows only mesh draw calls, or is that also including draw calls for material elements?

That’s all for now :] Thanks!

These are all legit questions, I don’t have the answers to most of them, but I wanted to post here just hoping someone would reply and give those of us still in this state a bit of a heads up. I have asked similar questions before but the answers would always be that “it depends” while this is true in its basic sense it doesn’t help at all with guidance. I believe the solution to this is something along these lines.

Comparison with current scenarios, and by scenarios we are talking about characters only, we will worry about the world later, the idea is to go step at a time during optimization. Get best performance with as best compromise acceptable on a character putting it into the environment. Later compromise on the environment since it’s easier:

Categories such as:

1 - What are the most optimal setup for high end characters, by “high end” we can deduce:

  • 150K to 300K triangle count for entire single hero character.
  • Bone count 500 -800+. (yes it’s not the bone count but rather per vertex, but then again we can do the math easily for a 200K triangle character vs 600+ bone count and come up with a rough estimate on all this, should be enough to get an idea of vertices deforming per bone) There’s also the bone limit per draw call issue here (I havent’ tested this).
  • Morph target vs facial skeletal rig on 12K - 15K triangle count for the head part. Morph target count on average for production for expressive characters 60 to 80 + targets.
  • corrective morphs on body. Count around 10.
  • cloth dynamics, cloth triangle count 5 - 10K for total deforming sim parts (this includes Latch to nearest thick clothing).
  • all the things you mentioned for textures, i’ll add one more thing here, 1 complex material layer function with multiples of 8K textures for the whole body ( head hair and eye not included since those are different shader types) so on estimate you’ll end up with 4 - 5 material draw calls at least VS 9 -10 draw calls splitting up the materials into subparts with 2K textures each, this includes semi complex material functions. So this is another question mark.

2 - Most optimal setup for mid range or res characters. (60K -100K triangle count).

  • you get the idea…

So all these questions I think should be discussed more often since for the most part it’ll be the worst thing to have setup and rigged a full character only to find out much later down the production line that it wasn’t the “most optimal setup” because there are 5 extra draw calls here because we misunderstood how unreal interpolates stuff or worst the morph targets were a bad idea or the facial bone rig count is off the roof etc.

I believe one solution to start getting the idea on performance is to look at two things:

Titles on PS4 hardware (or equivalent PC hardware setup), because PC can be just about any hardware, the idea is if it runs on PS4 kind of hardware then you are in safe hands.

Which brings me to the second point, look into Paragon character details. (these are not available yet) I’m not speaking of the availability of the models themselves but rather the specs and setup used. For instance how many material draw calls? how many triangle count vs bone count vs cloth sim Vs LOD’s per character. So if Epic could make available this info it’ll help. Also note that from what I’ve seen Paragon Characters have limited to no facial expressions, so this could be something else to consider on top.

Once you have this information then you can do a better job at managing expectations, as less trial and error is required. You can do the math such as draw calls on character count per screen vs performance for that particular aspect. Paragon is a higher end case (having 10 + high res characters on screen at once) and that’s one of the reasons to look at it.

It’s a start I think. Also this whole “depends” notion should be categorized into FPS vs third person vs puzzle platformer vs stylized/realistic scenarios. for instance it is relatively expected to get 60 fps running in an FPS game such as Battlefield on PS4 VS games with high character detail or characterization running on 30 fps such as Uncharted, The last of us, God of war (the latest).

Hope a rough chart of sorts is made by Epic and constantly updated to provide basic performance info with examples.

That’ll help a lot.

  1. Draw calls affect general performance, texture resolution will affect the amount of memory it uses, reducing the number of materials will reduce the draw calls. So in this case, using 3 1K textures in 3 materials will have more performance impact than having a single material with a single 2K texture. The only thing is that the second case will use a bit more memory space since it’s the equivalent of 4 1K textures. In that case, I would go with the single material. Also note, using multiple textures in a material does not affect the number of draw calls. However, also note that the complexity of the material will impact performance as well, though that impact is not as clear as the impact of draw calls.

  2. LOD’s don’t affect draw calls, it’s not drawing the other LOD’s so they don’t affect anything. The LOD helps control the amount of memory used, so it goes to lower resolution textures automatically after a certain distance, but it can also switch to a mesh with a lower polygon count. It can also reduce the framerate of animated meshes in the distance to improve performance that way too. LOD’s can lead to pop in though since it has to load things in and out of memory as you move around though.

  3. I’m not sure.

@darthviper107 Thanks for clearing these things up! I developed a project during Uni for VR, and I thought that having lower texture res but multiple material elements will be a better solution, obviously I was wrong, now I know why and how to approach this better :]

If anyone knows the asnwer for question 3, “Does the command “stat scenerendering” shows only mesh draw calls, or is that also including draw calls for material elements?” that would be awesome, I hope it does take into account every element that affect draw calls, would be easier to get an overview of the project.

@Tzur_H It does include material elements. For all intents and purposes a material element is a different material/shader and requires a draw call. Therefore yes, stat scenerendering includes this.