Quick answer: Shader compilation stutter happens when the game compiles a shader the moment it's first needed, blocking the frame. The cause is compiling on demand during gameplay rather than ahead of time, so new effects stutter on first appearance.

Shader compilation stutter, a hitch the first time a new effect or object appears, is a common and specific performance problem. It has a clear cause and a clear fix. Here's what causes shader compilation stutter.

Why Compiling Shaders Causes Hitches

Shaders, the programs that run on the GPU to render effects, often need to be compiled for the specific GPU before they can run. If that compilation happens at the moment the shader is first needed (during gameplay), it blocks the frame while it compiles, causing a visible stutter.

The telltale sign is a hitch the first time something appears, a new effect, a new object, entering a new area, because that's when its shader compiles for the first time. Subsequent appearances are smooth because the shader is already compiled. This 'first-time stutter' pattern is the signature of shader compilation stutter.

Why It's Easy to Miss in Testing

Shader compilation stutter is easy to miss because once you've played through an area, the shaders are compiled and it's smooth for you, so you don't see the first-time hitch a new player experiences. And compilation cost varies by GPU, so it can be worse on players' hardware than yours.

Bugnet's performance snapshots capture frame-time spikes from real sessions, so the hitches players experience, including first-time shader compilation, surface in your data even when your own replays are smooth. Capturing real-session performance reveals stutter your own testing hides.

Fixing Shader Compilation Stutter

The fix is to compile shaders ahead of time rather than on demand: pre-compile or warm up shaders during loading screens or startup, so they're ready before they're needed in gameplay. This moves the compilation cost out of the gameplay frame, eliminating the hitch when effects first appear.

Bugnet helps you confirm where frame-time spikes occur, so you can verify shader pre-compilation removed the hitches. So shader compilation stutter is caused by compiling shaders on demand during gameplay, and the fix is pre-compiling them ahead of time so the first appearance of an effect doesn't block the frame.

Shader compilation stutter happens when shaders compile on demand during gameplay, blocking the frame, hence a hitch the first time an effect appears. The fix is pre-compiling shaders ahead of time during loading.