What are DrawPrimitive calls and how to optimize scene?

Hi there. I am trying to use a large landscape I got from the marketplace and for some reason, it has very high DrawPrimitives:
image

Removing and/or replacing the landscape with another heightmap but same materials result in WAY lower calls.
image

Now I really do not mind replacing it however I wonder why this happens and want to learn. Also, I kinda liked the heightmap/landscape that I bought, however I seem to can’t use it without heavy FPS issues, at least in the editor, which bothers me.

If anyone can clarify/help me understand, I’d really appreciate it!

Hello,
It is quite complex to explain in one comment so I suggest taking this course, it explains everything and will help a lot with optimization

However, from what I see here is that in the first one the draw calls are high but the triangle count is low, however the second one has low draw calls while high triangle count.
I would play a bit with Landscape LOD in this case.
As it is now I feel that neither is ideally set up.
Unreal Engine Landscape Performance: Shader Complexity vs Triangle Count (with LOD Distribution) - YouTube let me know if any of this helps :slight_smile:

2 Likes

Hi! Yeah thanks for the links. In the first one LOD’s are setup but the second one is not because I literally just created it, however the interesting thing is with the 2.5m triangle draws I’m getting smooth 120+fps while on the first one with just 100k triangles I’m having 20-30 fps. That’s why I was wondering what the DrawPrimitive is actually exhausting…

I will check the links out and see if I can learn more!

According to this link, DrawPrimitive calls can be a serious bottleneck in DirectX 11 and OpenGL programs. They are the commands issued by the CPU for the GPU and, unfortunately, they have to be translated by the driver. This line in stat RHI shows the amount of draw calls issued in current frame (excluding only the Slate UI). This is the total value, so besides geometry (usually the biggest number) it also includes decals, shadows, translucent lighting volumes, post processing and more.

However it’s really not clear why this can occur and how to workaround it.

The basic idea is, every asset, every material on that asset, is a separate draw call, pretty much anything that needs to be rendered in is a draw call. Now with landscapes it is a bit different, however I’d look into the details when you create the landscape, these one specifically

I’d take a bit of time to test out different values and see what gives the best result.
Depending on the final build you are aiming for there are differences in budget. However, if I remember right, its ok if you have around 5-7mil triangles per scene, and around 3k draw calls. That being said this is not set in stone, and refers to ue4, and last gen consoles mainly.

1 Like

Thank you very much for the insight =)