Shader Complexity, Unreal Insights shows hitches but I don't see frame drops in unit graph

When playing the game in editor, PIE, packaged build I’m seeing fairly stable frames. I don’t feel frame hitching when I’m playing, and I don’t see any spikes in the unit graph. BUT I do see massive spikes in Unreal Insights.

I do have some glass in my scene which show “Extremely bad” shader complexity, so I suspect these may be the cause of the spikes in Unreal insights.

two questions:

  1. Should glass in Unreal have this much shader complexity as shown in my scene?
  2. Why does Unreal Insights show frame hitches, but unitgraph, stat fps, and my game feel not show it? Is Unreal insights calculating some asynchronous actions as if they are syncrounous?

The shader complexity view is not a frame-time measurement. It colors the pixel shader’s static instruction count, and on translucent pixels it shows the heaviest shader touching that pixel. Glass often lands on “extremely bad” because refraction, roughness, and a lit translucent shading model compile a huge shader, even when the pane only covers a few pixels and is not what is hitching. A single thin pane with refraction off should sit in the green or yellow range. Red usually means the material is doing too much (refraction on, several stacked translucent layers, or a lit translucent shader), not that Insights is timing it. Use the separate Quad Overdraw view for the stacking question. One or two layers means the red color is a shader-size warning, not overdraw.

Insights and stat unit disagree for a few specific reasons:

  • stat unit and the viewport unit graph are the game thread, plus a separate GPU line, and the graph is smoothed. A one-frame spike is easy to miss, and stat fps is an average.
  • Insights frame markers are every frame and unsmoothed. A spike on a worker, the render thread, or the RHI thread does not move the game-thread graph until that work actually stalls the game thread. With one-frame thread lag, the game thread keeps going while the GPU spikes.
  • The trace itself can create hitches. When the trace buffer fills, the writer stalls the game thread. Those spikes are not in a normal run. Capture with a small set of channels (cpu, gpu, frame) and compare a run with Insights off.
  • Insights does not count async work as if it were synchronous. A task only adds to the frame if that frame waits on it. Put the Frame track next to GameThread, RenderThread, and GPU. If the spike is only on a worker or on the trace channel, the player cannot feel it.

For the glass, ProfileGPU or stat gpu while you look through it is the number that matters, not the complexity color. If it is cheap there, leave it. If it is not, turn refraction off unless you need it, and use Quad Overdraw to find stacked panes.