DrawCalls values can fluctuate wildly

Hello everyone, something strange is happening with callDraw in my scene, the first frame is displaying normally, DrawCalls is 250. drawCall reaches 1200 in the second frame and then alternates.

Can someone help me answer what causes this?

If a Mesh call draws at a time, then the maximum drawCalls should be around 249, how can it jump to 1200?

This usually doesn’t have only one answer, a repo in the playground would definitely help.

Just looking at your inspector, the total meshes are the same, but the indices and draw calls have increased 5x.
What this means is that any layers, post processing, shadows, env, etc. increase to the draw call(Some may not.)

maybe you’re using point light + shadow


Glad to see others than me are struggling with it (sorry) :face_with_hand_over_mouth:

I’ve spent the last two weeks or so dismantling my scene, trying to understand and reduce draw calls.

As said above, there can be a number of processes that can impact drawcalls. I could add to the shorlist above a depth renderer (that could eventually kick-in after the first load?) If I remember correctly your scene (if it’s the same scene) had quite a number of things that can eventually cause this. You should try break it down one-by-one to identify the issue(s). May be it’s not just one but an addition/cumulative feature/process that makes for this result of *5. I would also start with 1) removing pp 2) removing shadows or in case of a custom depth renderer remove this one first. As I said, one by one, so you can get the numbers and eventually figure the relation between them. Because the value of *5 is unlikely to be the result of just one operation (in my opinion - and far from being expert here - still, a student :student:… a struggling student :dizzy_face: :wink:


yes, i use two direction light and case shadow.

Sorry, I may not be able to place the gltf file on the network. I will slowly debug my scenario, and if there are any new developments, I will explain them here.

Yes, when I removed some of the displayed items, the number of Drawcalls gradually decreased. I will slowly debug my scenario, and if there are any new developments, I will explain them here.

Hello everyone, the problem has been preliminarily identified. It is because of the high quality shadow that the number of Drawcalls increases. I used a 2048k high-quality shadow generator with 5000m.
Drawcalls isn’t in every frame. I was the cause of each frame will refreshRate adjustment is 4. There is no good solution to this problem, and it can only be adjusted slowly according to the situation.

I’m not sure about that. May be there’s a way to get acceptable result and better perf without cascading shadows? Let me just quickly ask the expert for this cc @Evgeni_Popov Could be worth getting his input before moving on.

You’ll get one new draw call per (visible) mesh per cascade. So, with 3 cascades, you triple the number of draw calls…

Unfortunately, there’s no way around this - it’s inherent to the technique. Try to lower the number of cascades if you run on a lower device.