If your scene looks correct in the Unity Editor but turns pink (magenta) in a player build, your material is usually not broken. The build is missing the shader variant that your runtime path needs.
This issue is common with Shader Graph + URP projects where variant stripping is too aggressive or quality tiers reference different render pipeline assets. This guide walks through the fastest stable fix path.
Problem summary
Typical symptoms
- Shader Graph materials render correctly in Editor, then appear pink in Windows, Android, or iOS builds.
- Only some scenes or quality levels break, while others look fine.
- Console or player logs include messages about missing shaders or unsupported passes.
Impact
- Visual regressions ship to QA or production.
- Teams waste time reimporting textures even though the root issue is shader variant availability.
Why this happens
In builds, Unity strips shader variants it thinks are unused. Shader Graph projects can still require those variants at runtime because of:
- Keyword combinations resolved only at runtime (quality level, feature toggle, renderer feature).
- Different URP assets per quality tier, where one tier does not include the same renderer settings.
- Missing warm-up path, so variants are never compiled into the player data.
The result is a material fallback, usually shown as pink.
Fix steps
Step 1 - Confirm which pipeline assets are active in build
Open:
- Project Settings > Graphics
- Project Settings > Quality
Make sure every quality tier used on target platforms points to the expected URP pipeline asset. A common failure is testing high quality in Editor while build defaults to a different tier with a different renderer setup.
Step 2 - Reduce over-aggressive shader stripping
In URP settings for your active pipeline asset:
- Review stripping options and disable overly strict variant removal during troubleshooting.
- Keep debug and release behavior consistent while reproducing.
- Rebuild after each stripping change so you can isolate the exact setting that removed required variants.
If you use custom build scripts, verify they do not force additional stripping flags in CI.
Step 3 - Add a Shader Variant Collection for critical materials
Create a Shader Variant Collection (SVC) that includes the Shader Graph variants used by key scenes:
- Enter the scenes where pink materials appear.
- Trigger relevant runtime states (quality switches, feature toggles, post-processing combinations).
- Save collected variants into an SVC asset.
- Include the SVC in preloaded assets or warm it during startup.
This makes your build deterministic instead of relying on accidental Editor state.
Step 4 - Ensure always-included coverage for must-not-fail shaders
For high-risk launch surfaces (main character, UI-critical materials), add required shaders to Always Included Shaders in Graphics settings while finalizing release candidates. This is a safety net, not a substitute for proper variant curation.
Step 5 - Rebuild with development logging and validate
Create a Development Build and inspect logs for stripped/missing shader warnings. Compare problematic and healthy scenes so you can map each warning back to a specific material or renderer feature.
Verification checklist
- The same scene no longer turns pink across all target quality tiers.
- Build logs no longer show missing shader variant warnings for affected materials.
- Runtime quality changes do not introduce new pink materials.
- CI and local builds produce consistent rendering for the same commit.
Alternative fixes for edge cases
- Addressables path: If materials or shader graphs are loaded from Addressables bundles, rebuild content catalogs and confirm shader dependencies are bundled correctly.
- Platform graphics API mismatch: Validate Vulkan/Metal/D3D settings against the shader target and feature usage.
- Keyword explosion: Remove unused global keywords that multiply variant space and increase stripping risk.
Prevention tips
- Keep a small smoke-test scene that instantiates every release-critical Shader Graph material in a player build.
- Lock URP asset mapping per platform and document any quality-tier overrides.
- Run automated build validation that scans logs for missing shader warnings before release approval.
FAQ
Why does this happen only in build and not Editor?
The Editor can compile variants on demand during development, while player builds depend on precompiled variants plus stripping rules.
Should I keep shaders in Always Included forever?
Use it selectively. It increases build size and memory use. Prefer a curated Shader Variant Collection once stable.
Can this be caused by renderer features?
Yes. Renderer features can introduce pass/keyword requirements that are absent in other tiers or stripped in build pipelines.
Related links
- Unity Decal Projector Not Rendering in Build - URP Renderer Feature and Material Fix
- Unity Particle System Not Visible in Build - URP and Shader Stripping Fix
- Unity Addressables Remote Catalog Hash Mismatch After CDN Purge - Cache-Busting and Build Path Fix
- Official Unity docs: Shader variant stripping and Scriptable Render Pipeline settings
Bookmark this fix for your release checklist, especially if your team frequently changes URP settings late in production.