UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

graphics

[URP] Fix Gfx.WaitForPresentOnGfxThread Spikes from High Far Clip Plane

Solution

profilingoptimizationcamerarenderinggpuframe rate

Unity 2021.x - Unity 6.3.x

Published Mon, May 4

Issue

 Performance degradation occurs during scene transitions, characterized by spikes in the Gfx.WaitForPresentOnGfxThread marker. Despite using SceneSystem to unload your script and entities, the rendering load accumulates, suggesting a bottleneck in how the Camera processes the Far clipping plane.

High Far clipping plane values cause excessive over-rendering and GPU stalls, manifesting as Gfx.WaitForPresentOnGfxThread in the Profiler.

Explanation

The Gfx.WaitForPresentOnGfxThread bottleneck during scene transitions is primarily caused by a Camera configured with an excessively large Far clipping plane. Setting this value too high forces the GPU to process depth for a massive volume, resulting in overdraw and cumulative rendering load.

To optimize performance, adjust the Far clipping plane:

  1. Locate the active Camera component in your script.
  2. In the Inspector, find the Clipping Planes section.
  3. Lower the Far value to the smallest distance possible for your environment.
  4. Check if multiple cameras are active, which compounds the Far plane calculations.

Additional Tips

  • Use Occlusion Culling to prevent the GPU from processing objects hidden from view.
  • Enable the Frame Debugger to see if specific draw calls are hitting the Far plane limit.
  • If using VSync, Gfx.WaitForPresentOnGfxThread may also indicate the CPU is waiting for the monitor’s refresh rate.

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.