Course contentsShow
← Unity Game Development
Lesson 709 of 82810. VFX and Post-ProcessingFree lesson

Debugging Lighting Issues with Frame Debugger

You will learn to use the Frame Debugger to identify expensive draw calls and lighting bottlenecks within your rendered scenes.

In this lesson, you will learn how to leverage the Unity Frame Debugger to visualize the rendering pipeline and pinpoint exactly where your lighting performance is being bottlenecked.

While the Rendering Debugger is excellent for toggling high-level features, the Frame Debugger allows you to "scrub" through the exact sequence of draw calls Unity executes to build a single frame. This is crucial for identifying why your lighting might be unexpectedly expensive.

Identifying Draw Call Bloat

When debugging lighting, open the Frame Debugger via Window > Analysis > Frame Debugger. As you move the slider, you will see exactly when specific lights are processed. If you notice a high number of "Draw Mesh" calls under a single light pass, it indicates that your lights are touching too many objects, likely due to excessive overlapping lights or high draw distance settings.

Visualizing Light Passes

One of the most common lighting issues is overdraw from excessive real-time lights. By navigating to the Render Camera node in the Frame Debugger tree, you can inspect individual rendering passes. If you see multiple passes for Light+Shadow or ForwardAdd (in Built-in) or specific Main Light and Additional Light passes (in URP), you can identify if a single frame is rendering the same geometry multiple times to compute lighting contributions.

To test this, you can isolate specific shader passes. For example, if you suspect a complex material is causing lighting calculation spikes, check if the Render.OpaqueGeometry call is unusually slow or fragmented across multiple draw calls.

Analyzing Shadow Map Generation

The Frame Debugger also lets you inspect the shadow maps being generated for your lights. If you see a shadow map being redrawn for every light, even when objects haven’t moved, you have a clear indicator that your shadow settings—such as "Shadow Type" or "Shadow Update Frequency"—are not optimized. This allows you to verify if your static objects are correctly baked or if they are incorrectly forcing redundant real-time shadow updates.

Key Takeaway: The Frame Debugger transforms your lighting bottlenecks from invisible performance killers into a step-by-step visual sequence, allowing you to identify redundant shadow passes and excessive light-to-object intersections with surgical precision.