# ArgumentException: 当前渲染管线与材质'DefaultMaterial'不兼容

- **ID:** `unity/rendering-pipeline-asset-missing`
- **领域:** unity
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

材质的着色器期望特定的渲染管线（如URP或HDRP），但项目配置了不同的管线，或者图形设置中缺少管线资源。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Unity 2022.3 | active | — | — |
| Unity 2023.1 | active | — | — |
| Unity 2021.3 | active | — | — |

## 解决方案

1. ```
   在编辑 > 项目设置 > 图形 > 脚本化渲染管线设置中分配正确的渲染管线资源（例如URP-HighQuality或HDRP）。如果不存在，通过资源 > 创建 > 渲染 > 通用渲染管线 > 管线资源（对于URP）创建。
   ```
2. ```
   如果材质来自包，确保包版本与安装的管线匹配。对于URP，将材质的着色器添加到图形设置中的始终包含的着色器列表中。
   ```
3. ```
   对于自定义着色器，添加#pragma require derivatives或适当的管线标签使其兼容，或使用回退着色器。
   ```

## 无效尝试

- **** — The material is not corrupted; the issue is a pipeline mismatch. Reimporting does not change the shader compatibility. (95% 失败率)
- **** — While this might remove the error, it bypasses the intended rendering pipeline and can cause visual inconsistencies or lost features. (70% 失败率)
- **** — If the project assets (shaders, post-processing) are designed for URP/HDRP, switching to Built-in will break many effects and is often not a viable fix. (80% 失败率)
