Course contentsShow
← Unity Game Development
Lesson 70 of 8281. Unity FoundationsFree lesson

Inspecting Draw Calls with Frame Debugger

Learners will step through individual draw calls to identify batching issues and excessive rendering instructions for specific game objects.

In this lesson, you will learn how to use the Unity Frame Debugger to visualize exactly how your GPU renders your scene, helping you pinpoint inefficiencies like excessive draw calls.

What is a Draw Call?

A draw call is a command sent from your CPU to your GPU telling it to render a specific object. If you have 100 separate objects in your scene, your CPU might send 100 individual "draw" instructions. Sending these instructions takes time; if you have too many, your game’s frame rate will drop. Ideally, Unity "batches" these objects together, drawing many of them in a single instruction.

Stepping Through the Frame

To see this in action, go to Window > Analysis > Frame Debugger. Click the Enable button while your game is running. You will see a list of every draw call executed during a single frame.

When you click on a draw call in the list, the Game View will update to show only what was rendered by that specific instruction. This is an incredibly powerful way to debug performance:

  1. Identify Batching Issues: If you have ten identical trees, you want to see them rendered in one or two draw calls. If you see ten separate draw calls for those trees, the Frame Debugger will highlight that they aren't being batched (perhaps because they use different materials or have unique scaling).
  2. Analyze Render Order: The list shows exactly what order objects are drawn. You can step through these to see if you are rendering objects behind opaque walls that aren't visible, which is a common waste of GPU power.
  3. Inspect State Changes: The Frame Debugger panel on the right side provides details on why a batch might have been broken, such as changing a shader parameter or a texture.

By observing how your scene is constructed piece-by-piece, you can identify which objects are "breaking" your batches and forcing the CPU to work harder than necessary.

Key Takeaway: The Frame Debugger allows you to inspect your scene’s rendering process step-by-step to discover why objects are being drawn individually rather than batched together.