Will 3ds max (attach) reduce my draw calls? (Optimization)

  1. Recently, I had a talk with my level designer in Unreal about draw calls. And he suggested that I attach some models as a single object instead of several different.
    So, I thought, what if I attach all static (non-interactable) meshes (for example: all of the objects in one room) and make them a single object. Then do the same thing to all the other objects in another room of a house.

Will it improve performance and reduce draw calls? After all, if I even attach them, they would all have Material IDs and it would be a Single mesh with over 40 materials inside.

  1. And also, I checked Unreal’s Automatic LOD. So I wondered, does it only reduce triangles or its “mipmaps” will also reduce the texture size?

Each material will add an additional draw call, so when you’re trying to merge things you can start by looking at the objects that use the same material. You also have to consider objects that are in the same area–for example if you attach too many things then it has to render the whole thing even if most of it isn’t visible just because part of it is. The other thing to keep in mind is lighting. If you can’t get good lighting detail without using a very large lightmap then you would need to separate the mesh so that it can use additional lightmaps.

If you are really struggling with draw calls, you can even attach dynamic elements together, like a flock of birds with each bird connected octopus-style to a root with the animation affecting the whole flock. It doesn’t have to be static.

That said, this is fine to think about, but, ultimately, your optimization should be driven by your real bottlenecks.

Like Darthviper107 said, objects that are joined are drawn together. This means that geometry that’s not in your view (because it’s occluded or literally not even in the camera’s view direction) cannot be culled if it’s bundled with geometry that is in your view. In other words, if you are nowhere near your draw call budget, and combine every object in the room together into a single object, then, when standing in the middle of the room with an FOV of 90 degrees, you will be rasterizing all geometry when the camera can only see a quarter of it (because the other 3/4s are in the 270 degrees you can’t see).

So you spent time… to lose performance… trying to optimize something that was never a bottleneck to begin with.

On the other hand, if submitting objects to the RHI is a significant portion of your frame, then yes, you can reduce that by submitting fewer draw calls. Every individual object in the scene contributes one draw call for every material it has. If you have Object A with three materials, Object B with two materials, and Object C with one material, then you have 3 + 2 + 1 = 6 draw calls. Combining A, B, and C will create Object X with six materials. Still 6 draw calls. If one of those materials is shared between A, B, and C, then you can make an Object X with just four materials, thus four draw calls… a 33% reduction in draw calls!

But… did you have to reduce the quality of the material? Is the material complicated, with multiple textures masked together, etc.? How long did you take to make it? If your draw call count was eating you alive, then this might be worth it. If not, then you might have actually traded off something that wasn’t a bottleneck by further-suffocating something that was.

Again, one draw call for every material of every individual object. Think about whether that’s a problem before wasting too much time / making a mess of your project, though. Your performance analysis tools (profiler, UE4’s stats commands, etc.) will point out your hotspots for you. You’ll eventually learn patterns and tricks based on past experiences.

Thank you all for the replies, well, the highest draw call number we’ve reached at the moment is around 100 draw calls in a frame at one place, which I believe it’s not too much for a game we’re struggling to optimize as much as possible. Also, we still haven’t implemented LOD to optimize it even more.

If you made the entire scene a single static mesh, you would reduce draw calls. (If it was all one material, then possibly even one draw call)

But the reason you don’t want the entire level as a single mesh is culling.

Draw calls are not inherently bad, and they do not represent the complexity of the scene.

Nor are they the most expensive and costly thing.

A single draw call with 20M verts is much much more expensive than 10 draw calls with 1000 verts each.

Consider an alley scene, at the end of a city block.

With frustum and occlusion culling, you only have to render the visible pieces of the scene, instead of the entire city block.

Hobson has a summary:
http://timhobsonue4.snappages.com/culling-visibilityculling.htm

Yes, 100 drawcall is not that much - and it is already low that you should actually worry about something else. You have to check whether the game is gpu or cpu bound, and then act appropriately.

VR and Mobile are more sensitive to draw calls, but that’s peanuts for a PC. Many AAA games will be in the low 10,000s of draw calls, although they work really hard at it. You’ll probably start to see UE4 (DirectX 11) slow down when you hit the mid 1000s of draw calls.

Another way is to use Atlas textures to reduce the materials usage.

That helps reduce material complexity in general, but a material on an object is a material even if it’s used on other objects it’s a draw call–I bet it would even increase draw calls to use the same material in multiple material slots.

Hi, approximately, how many draw calls can an average android today handle? Also what is the max drawcall a high end android can handle? Thanks.

nevermind, I found my answer here. Performance Guidelines for Mobile Devices in Unreal Engine | Unreal Engine 5.3 Documentation

They recommend less than 700 there, but it’s hard to tell because android devices are so different there’s no standard, and it also depends on what other things you have going on.