Shader Compilation Stutter
Hitches the first time an effect or material appears
Also known as: Unreal shader stutter · Unity shader stutter · PSO stutter · Shader compile hitch · First-time hitch game · Pipeline state object
Quick answer
Shader compilation stutter is a freeze or hitch the first time a material, effect or mesh appears, because the engine compiles its shader or pipeline state while the game runs. The fix is to compile earlier: precache or warm up shaders during loading, reduce the number of shader variants and unique materials, and make sure the engine's pipeline state caching is enabled. Once a shader has been compiled and cached, the hitch should not return.
How to fix it
In Unreal Engine, recent versions precache pipeline state objects, and you can ship a bundled PSO cache for the final game. In Unity, prewarm shader variants with a Shader Variant Collection at the loading screen and keep keywords under control. Test with a clean shader cache, since your own machine hides the problem, and play through the first minutes of the game. Fewer shared master materials mean fewer shaders to compile.
Tools that use Shader Compilation Stutter
See also
Shader Variants
Compiled versions of one shader
Master Material
Parent material that spawns instances
Shader Complexity
Viewport view of per-pixel material cost
Profiling
Measure before you optimize
Technical Artist
Bridge between art and engineering
CPU Bound vs GPU Bound
Which processor limits the frame rate