Shader Variant Collections

intermediate concepts

Shader Control · Core Concepts

Shader Variant Collections

Shader Control can create Shader Variant Collection assets to prewarm shaders at startup, preventing runtime compilation stalls (hitches). For background on this Unity feature, see the official Unity documentation.

What is a Shader Variant Collection?

A Shader Variant Collection groups one or more shaders with specific keyword combinations (variants). Unity loads and compiles these variants during scene load or via scripting, avoiding the stutter that occurs when a shader is first used at runtime.

Creating a Collection from Build View

  1. Open the Build View in Shader Control.
  2. Locate the shader you want to prewarm.
  3. Expand it and click the Advanced button.
  4. Specify the keyword combinations (variants) your game actually uses.
  5. Click Create Shader Variant Collection.
Build optimization bonus: When you specify variants from the Advanced window, Shader Control ignores all other variants for that shader during build — saving compilation time and reducing build size.

Next Steps

See the Window Stats page to understand the impact of your changes on total variant count.

Was this page helpful?