Quick answer: Pink or magenta materials in Unity indicate a missing or broken shader. This happens most commonly when switching render pipelines (from Built-in to URP or HDRP) without upgrading materials, when a shader has compilation errors, or when shader variants are stripped during the build process.

Here is how to fix Unity shader pink magenta material. Everything in your scene has turned a vivid pink or magenta. Your 3D models, your terrain, your particle effects — all rendered in the same eye-searing color. This is Unity's way of telling you that the shader assigned to one or more materials cannot be found or compiled. The bright magenta is a deliberate fallback color chosen to be impossible to miss, and it means the GPU has no valid shader program to execute for those materials.

The Symptom

Some or all objects in your scene render as solid pink/magenta in both the Scene view and Game view. When you select an affected material in the Inspector, the shader field may show Hidden/InternalErrorShader or display a yellow warning triangle. The Console may contain shader compilation errors such as "Shader error in '...': unrecognized identifier" or "Material doesn't have a texture property '_MainTex'". In some cases, materials look fine in the Editor but turn pink in builds.

This issue can appear suddenly after upgrading your project to a new render pipeline, after importing an Asset Store package built for a different pipeline, or after updating Unity to a new version. It can also appear only in builds while the editor looks correct, which points to shader variant stripping.

What Causes This

Unity assigns the magenta error shader whenever a material's shader cannot be loaded, compiled, or found. The three main scenarios are:

The Fix

Step 1: Identify which materials are broken and why. Start by finding out what shader the broken materials are trying to use. Select a pink object, look at the Material in the Inspector, and check the Shader dropdown. You can also write an Editor script to scan your entire project for broken materials:

using UnityEngine;
using UnityEditor;

public class BrokenMaterialFinder
{
    [MenuItem("Tools/Find Broken Materials")]
    public static void FindBrokenMaterials()
    {
        string[] guids = AssetDatabase.FindAssets("t:Material");
        int brokenCount = 0;

        foreach (string guid in guids)
        {
            string path = AssetDatabase.GUIDToAssetPath(guid);
            Material mat = AssetDatabase.LoadAssetAtPath<Material>(path);

            if (mat == null) continue;

            // A null shader or the error shader means the material is broken
            if (mat.shader == null
                || mat.shader.name == "Hidden/InternalErrorShader"
                || mat.shader.name.Contains("Error"))
            {
                Debug.LogWarning(
                    $"Broken material: {path} (shader: {mat.shader?.name ?? "null"})",
                    mat
                );
                brokenCount++;
            }

            // Also flag Built-in shaders if project uses URP
            if (UnityEngine.Rendering.GraphicsSettings.currentRenderPipeline != null
                && mat.shader.name.StartsWith("Standard"))
            {
                Debug.LogWarning(
                    $"Material using Built-in shader in SRP project: {path}",
                    mat
                );
                brokenCount++;
            }
        }

        Debug.Log($"Scan complete. Found {brokenCount} broken or mismatched materials.");
    }
}

Step 2: Upgrade materials to the correct render pipeline. If you switched from Built-in to URP, Unity provides a batch conversion tool. Go to Window > Rendering > Render Pipeline Converter. Select Built-in to URP, check Material Upgrade, click Initialize Converters, and then Convert Assets. This converts Standard materials to URP/Lit, and other built-in shaders to their URP equivalents. For materials from Asset Store packages, you may need to manually reassign the shader:

using UnityEngine;
using UnityEditor;

public class MaterialPipelineFixer
{
    /// Converts all Standard shader materials in a folder to URP Lit.
    [MenuItem("Tools/Convert Standard to URP Lit")]
    public static void ConvertStandardToURPLit()
    {
        Shader urpLit = Shader.Find("Universal Render Pipeline/Lit");
        if (urpLit == null)
        {
            Debug.LogError("URP Lit shader not found. Is the URP package installed?");
            return;
        }

        string[] guids = AssetDatabase.FindAssets("t:Material");
        int converted = 0;

        foreach (string guid in guids)
        {
            string path = AssetDatabase.GUIDToAssetPath(guid);
            Material mat = AssetDatabase.LoadAssetAtPath<Material>(path);

            if (mat != null && mat.shader.name == "Standard")
            {
                // Preserve textures before switching
                Texture mainTex = mat.GetTexture("_MainTex");
                Color color = mat.GetColor("_Color");
                Texture normalMap = mat.GetTexture("_BumpMap");
                float metallic = mat.GetFloat("_Metallic");
                float smoothness = mat.GetFloat("_Glossiness");

                mat.shader = urpLit;

                // Reassign properties to URP names
                mat.SetTexture("_BaseMap", mainTex);
                mat.SetColor("_BaseColor", color);
                mat.SetTexture("_BumpMap", normalMap);
                mat.SetFloat("_Metallic", metallic);
                mat.SetFloat("_Smoothness", smoothness);

                EditorUtility.SetDirty(mat);
                converted++;
            }
        }

        AssetDatabase.SaveAssets();
        Debug.Log($"Converted {converted} materials from Standard to URP/Lit.");
    }
}

Step 3: Fix shader variant stripping for builds. If materials look correct in the Editor but turn pink in builds, shader variants are being stripped. Create a ShaderVariantCollection asset to explicitly tell Unity which variants to keep. Go to Assets > Create > Shader Variant Collection, add your shaders and keyword combinations, then reference the collection in Edit > Project Settings > Graphics > Preloaded Shaders. You can also add critical shaders to the Always Included Shaders list:

using UnityEngine;
using UnityEngine.Rendering;

/// Attach to a GameObject in your first scene to verify
/// shaders are available at runtime.
public class ShaderAvailabilityChecker : MonoBehaviour
{
    [SerializeField] private string[] _requiredShaderNames = new string[]
    {
        "Universal Render Pipeline/Lit",
        "Universal Render Pipeline/Unlit",
        "Universal Render Pipeline/Particles/Unlit",
    };

    void Start()
    {
        foreach (string shaderName in _requiredShaderNames)
        {
            Shader shader = Shader.Find(shaderName);
            if (shader == null)
            {
                Debug.LogError($"Shader '{shaderName}' not found in build! "
                    + "Add it to Always Included Shaders or a ShaderVariantCollection.");
            }
            else
            {
                Debug.Log($"Shader '{shaderName}' is available.");
            }
        }
    }

    /// Call this to fix a specific material at runtime if its
    /// shader was lost (e.g., after loading an asset bundle).
    public static void RepairMaterial(Material mat, string targetShaderName)
    {
        if (mat.shader.name == "Hidden/InternalErrorShader")
        {
            Shader replacement = Shader.Find(targetShaderName);
            if (replacement != null)
            {
                mat.shader = replacement;
                Debug.Log($"Repaired material '{mat.name}' with shader '{targetShaderName}'");
            }
        }
    }
}

If you are using Shader Graph, also verify that the shader graph files compile without errors by selecting them in the Project window and checking for error badges. Shader Graph nodes that reference removed or renamed functions after a Unity version upgrade will produce compilation failures and pink materials.

Related Issues

See also: Fix: Unity Rigidbody Jittery or Stuttering Movement.

See also: Fix: Unity AudioSource Not Playing Sound.

Pink means the GPU has no shader to run. Check your render pipeline first.