Extremely High Draw Calls

Hi there,

So I’ve been working on a project that has extremely high draw calls which cause my frame to drop to around 50ms (around 20 frames per second). I’m just going to give as many details as I have discovered and hopefully, someone can help me with this issue.

I’ve been spending the last two days trying to find out what is causing my draw calls to go up to 7000-8000 at some specific parts of my scene.

So what I did was I hid every mesh using this command “showflag.staticmeshes 0”. The draw calls went down from 7000 to 6500.

I hid every light and the results were quite shocking. The draw calls were reduced from 6500 to 4500, but still quite high.

I hid almost everything (not everything because if I press alt+a my unreal engine crashes) and I got about 3500 draw calls. This is extremely confusing because the scene was pure black at that point but the draw calls were still high.

I managed to somehow hide everything but a cube by selecting the option “Show only selected”. I still had 300 draw calls.

I then created a new level in the same project, opened it and I had only 90 draw calls with a directional light, sky atmosphere, a sky and etc.

By the way, I’m using an RTX 2060, core i7 6600k, and 16GB of ddr3 ram.
My target device is also computers with the same specs or higher.

I also know that the problem is not from my GPU because in the stats the GPU ms was as low as 15 ms and I also tested this project with an RTX 4090 as well.

I would really appreciate it if anyone can help me to find the solution to this issue.

8000 draw calls is nothing. 1,000,000 would be fine for a normal game scene.

How do you know it’s draw calls causing the problem?

If your GPU load is very low, then it definitely isn’t draw calls. It will CPU bound. Maybe it’s something you’re doing on tick?

Reading it again, I’m wondering if you mean 8000 objects in the scene?

2 Likes

Hey ClockworkOcean,

I’ve enabled the unit details and from what I saw the draw was on 50ms which was also red. I’m assuming my draw is too high because every time my draw calls (which I also enabled from the stats) go up to 8000 my game goes on 10 fps.

I also have to mention that I haven’t programmed anything yet and have no animations or physics in the scene. Purely the design with some objects using nanite and the character I use to walk around is the default Unreal Engine character.

If you need any screenshots or specific details about my scene please let me know because solving this would be a huge help.

Edit: I also launched different projects like Lyra or my old projects. They have an average of 500 draw calls and my fps is on 80.

Can you show a picture of the scene, with ‘stat unit’ in the corner?

1 Like

At the exact location, I have the highest draw calls. I’m not sure is the Draws the draw calls or the prims?

ScreenshotWithTheDrawCalls

That looks like a lot of VRAM getting used there. I’m wondering about how many textures you’re using in the scene, or perhaps a lot of different models.

The number of primitive draws is fine. ( 5k ).

1 Like

I’m quite confused because most of the textures are either 2k in jpg format or really low quality such as 500*500 or even less with a 20kb size. There are however a lot of materials that are not instanced. Does that have anything to do with this?

I also have to add that my Vram increases exponentially when I enable nanite even though the meshes don’t have more than 1000 tris and only like around 5 meshes in the whole scene have 10k or less.

Turn off Nanite, for sure.

A lot of materials could do it too.

If you restart the editor, then load this scene, does it still show much VRAM usage?

I’ve turned off the Nanite. Surprisingly my VRam is still on 20gb and I’m getting lower frames.

Is there a way to confirm if the materials are actually causing this problem?

Because in Ari’s video in Unreal Fest about optimization he said make sure you know what is slowing down your project first so I’m trying to confirm it but I don’t know how to.

There is a way that’s frankly easier than profiling. Basically, you run a ‘binary’ chop on the assets: ( disable auto save )

  1. Check removing everything from the map gives you back your fps

  2. Then remove only half, to figure out which half holds the problem.

  3. Then only remove half of that half, and so on.

This won’t hunt down subtle problems, but will catch 90% of them.

It’s very hard to troubleshoot this sort of thing remotely. But there must be something pretty off to bring this rig to its knees like this.

If you want to know if materials is the problem, just set everything to ‘basic shape material’ and see what happens. Also, if your scene consists of thousands of different meshes, all with different materials, that would do it ( cause the problem ).

1 Like

Alright, I will try it. Thank you so much!

I’ll let you know how it goes.

I would take a look for you, but I don’t think my system will even load it :smiley:

1 Like

Hahahaha, true my project is really unoptimized :joy: :joy: :joy:

If you textures are 500x500 and not 512x512, they might not mip or reduce resolution correctly. You can also try setting the texture resolution scalability setting to low just to see if lowering texture detail improves things enough.

Definitely this, textures should be power of two

2 Likes

For sure, I’ll convert all the textures into the power of two and I’m assuming this is because of the texture LOD?

This is going to be extremely painful tho :sob:

what lighting setup are you using in this project? Lumen? How many lights?

If you wanna cut the level down a bit and migrate it to an empty project, you can PM me a link if you like. I can probably load a more minimal version.

1 Like

Lumen with about 200 lights but I’m assuming not all of them render at the same time no?

Sure thing I’ll let you know if I was struggling with migrating but I’m really hoping that I don’t get to that point.

1 Like