Course contentsShow
← Unreal Engine Game Development
Lesson 851 of 88012. World Building and DeploymentFree lesson

Debugging Landscape and Foliage Draw Calls

You will use Unreal Engine's profiling tools to identify and resolve performance bottlenecks caused by overdraw and excessive geometry in your ecosystem.

In this lesson, you will learn how to isolate and resolve performance bottlenecks in your terrain and vegetation systems by identifying excessive draw calls using engine profiling tools.

Visualizing the Bottleneck

When building dense environments, draw calls often spike due to "overdraw" or an inefficient distribution of Hierarchical Instanced Static Meshes (HISM). To see what the GPU is actually processing, use the console command r.VisualizeOccludedPrimitives 1 to see if your Landscape is rendering assets that should be hidden behind terrain.

To get a clearer picture of your draw call count, open the Stat Unit overlay (stat unit) and compare the Draw time versus GPU time. If your Draw time is significantly higher, you are likely CPU-bound by the number of individual mesh instances being sent to the renderer.

Profiling with the GPU Visualizer

The most powerful tool for this is the GPU Visualizer (Ctrl + Shift + ,). When you trigger this during a frame with dense foliage, look specifically at the BasePass section. You are looking for:

  1. Excessive Mesh Passes: If your foliage materials have many layers or complex masking, you will see a massive spike in the BasePass.
  2. HISM Batching: Check if your foliage is properly instanced. If you see thousands of individual draw calls for the same tree, your HISM clusters may be too small, or they are not being culled efficiently by the Cull Distance settings in your Foliage Type assets.

Resolving Draw Call Spikes

If your profiling identifies excessive draw calls, you can mitigate them by adjusting the Instance Settings within your Foliage Type:

  • Cluster Size: Increase the Instance Cluster Min/Max Distance to group more meshes into a single draw call.
  • Culling: Set a strict Cull Distance to ensure that objects outside of a player's immediate view frustum are not being submitted to the render thread.
  • Landscape Optimization: Ensure your Landscape material isn't using too many texture samples, as this increases the complexity of the BasePass for every landscape chunk rendered.

Key Takeaway: Use the GPU Visualizer to identify if high draw calls originate from poor instancing clusters or inefficient material complexity, then tune your Cull Distances and HISM settings to batch geometry effectively.