unity build_error ai_generated true

Build warning: too many shader variants compiled

ID: unity/shader-variant-explosion

Also available as: JSON · Markdown
78%Fix Rate
82%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2022 active

Root Cause

Excessive shader variants increasing build time and size.

generic

Workarounds

  1. 88% success Use shader_feature_local instead of multi_compile where possible
  2. 90% success Create ShaderVariantCollection for needed variants only

Dead Ends

Common approaches that don't work:

  1. Use shader_feature for everything 78% fail

    Missing variants at runtime

  2. Strip all shader variants 82% fail

    Visual artifacts