Massive performance hit cause by enabling shadows

The massive green part in the profiler (Gfx.WaitForPresent) is only present when I enable shadows and renders the game completely unplayable. Any ideas on how to fix this?

This behavior only occurs in Unity 5.x.

I think Gfx.WaitForPresent is vsync. And judging from your framerate I’m guessing you’re able to keep 60fps without shadows, but when you enable them you drop below 60 and then vsync immediately limits you to 30fps. Try disabling vsync in the quality settings.

1 Like

Gfx.WaitForPresent is not just vsync, it’s generally the CPU waiting for the GPU to finish. This is either forced, through VSync or other frame rate locks, or simply because the GPU is really busy, say rendering shadows. Decreasing the shadow quality, the amount of shadow casters and shadow casting lights will improve your FPS.

1 Like