Shader variants and stripping
Related terms: shader keywords, permutations, build-time stripping
A shader can compile into different versions for different feature combinations, such as normal mapping on or off. Each version is a variant. Three independent on/off features already allow eight combinations; more switches can multiply build time, storage and memory use quickly.
Stripping removes variants the game does not need before they reach the build. Keep combinations that runtime changes or downloaded content may require, even if no starting scene uses them. Stripping reduces the work to compile and store shaders; warming up the remaining variants addresses a different problem, compilation stutter during play.
- Further reading
- Unity: shader variant stripping