How do I see draw call statistics?

In UDK, we could see these statistics via console commands. What is the UE4 equivalent?

I can only see profiling as a way of statistics, but that doesn’t show draw calls.

Edit: Apparently, console key was not set correctly, I had to go to the baseinput file to edit the console key.

1 Like

stat d3d11rhi

That should help.
if you really want to check for bottlenecks you should use profilegpu (just type profilegpu in console).

Hm stat d3d11rhi works fine for me. Though I’m using bit older build right now, and still waiting for new one.
Maybe something changed

You can type it editor (upper right corner have small console text box) or in console during game.

That’s odd. Someone with access to new build should take it from now. Maybe I will be able to help later this day.

It is inside stat scenerendering

Thanks hourences.

1 Like

A more detailed answer would be:
You can either push the ` key to bring up the console and type the “stat scenerendering” command, or you can use the Shift+L shortcut or go to the top left of the 3D viewport, push the little down arrow and select Show Stats.

1 Like

Also, the console commands can be written on the output log window.

try command: stat rhi

1 Like

I tried stat scenerendering with unreal 4.18, and I got draw call info

248797-stat-scenerendering.png

248797-stat-scenerendering.png

I tried “stat scenerendering” on Unreal 4.18 and this one displays draw calls

For anyone else coming here via google search, I’ll provide you with a much better breakdown.
Opening the console and typing ‘stat unit’ (without the quotes) gives you a really easy-to-read view of the cost of your rendering. It will show the total time in milliseconds (ms) it takes for each category: Frame, Game, Draw, GPU as well as giving you the number of Draws (draw calls) and total Primitives in the scene.

The simple equation to figure out what your target ms for your game is: Take 1000 (milliseconds in a second) and divide it by your target FPS. So 1000/60 = 16.6ms.
So you want your total MS for “Frame” to be less than 16.6. Frame means how long it takes to draw a single frame to the screen. Contrary to what a lot of people think, if your game is Single Player then you DO NOT need to target 60fps. Of course, it’s better, but don’t stress yourself if you’re getting closer to 30. It’s only if you see frequent dips below 30 that you need to be concerned.

The “Game” category is how long your code is taking to render. This is how you can get an idea of how long the CPU is taking to calculate things like blueprints or C++.

"GPU" is obvious.

"Draws" is the number of Draw calls for the scene (expect this to be high, even an empty level has 132 draws).

"Prims" is mostly a non-issue (again 4127 for an empty level) and just gives you an idea of your scene complexity. It’s not really something you need to worry about even when developing for mobile.

Once you’ve got a handle on the simplified breakdown in stat unit, you can then use “stat scenerendering” for the more robust breakdown.

Finally ‘stat gpu’ will give you a more detailed breakdown of all the different categories contributing to the GPU cost to allow you to target specific areas for optimization like Lights, Translucency, etc.

15 Likes

I wanted to update this post…
After further study, the Draw Calls shown with Stat Unit are for the entire scene, but if you use Stat scenerendering in an empty scene, it will give you a much better idea of the number of draw calls an individual mesh is taking. An empty scene will only show 1 draw call (the minimum). If you have your mesh selected it will more than double the draw calls due to the outline effect the editor places on a selected mesh, so be sure to de-select your mesh for a true readout. Also, keep your mouse cursor in the 3D window to get an accurate readout. If you hover over the content browser, your draw calls go up to 47.

You want your draw calls to be as low as possible. 1 being the best, 10 or under being manageable. The Unreal Mannequin for example is 7 draw calls. The draw calls will increase with each unique texture/material on your mesh, so it’s always better to have one texture per mesh. For each new texture, the engine has to render the mesh entirely again.

1 Like

to see drawcalls by categories (prepass, basepass, tranclucency and so on):

stat DrawCount

7 Likes