ArgumentException: 当前渲染管线与材质'DefaultMaterial'不兼容
ArgumentException: The current render pipeline is incompatible with the material 'DefaultMaterial'
ID: unity/rendering-pipeline-asset-missing
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| Unity 2022.3 | active | — | — | — |
| Unity 2023.1 | active | — | — | — |
| Unity 2021.3 | active | — | — | — |
根因分析
材质的着色器期望特定的渲染管线(如URP或HDRP),但项目配置了不同的管线,或者图形设置中缺少管线资源。
English
The material's shader expects a specific render pipeline (e.g., URP or HDRP) but the project is configured with a different pipeline, or the pipeline asset is missing from Graphics Settings.
官方文档
https://docs.unity3d.com/Manual/srp-setting-default-pipeline.html解决方案
-
在编辑 > 项目设置 > 图形 > 脚本化渲染管线设置中分配正确的渲染管线资源(例如URP-HighQuality或HDRP)。如果不存在,通过资源 > 创建 > 渲染 > 通用渲染管线 > 管线资源(对于URP)创建。
-
如果材质来自包,确保包版本与安装的管线匹配。对于URP,将材质的着色器添加到图形设置中的始终包含的着色器列表中。
-
对于自定义着色器,添加#pragma require derivatives或适当的管线标签使其兼容,或使用回退着色器。
无效尝试
常见但无效的做法:
-
95% 失败
The material is not corrupted; the issue is a pipeline mismatch. Reimporting does not change the shader compatibility.
-
70% 失败
While this might remove the error, it bypasses the intended rendering pipeline and can cause visual inconsistencies or lost features.
-
80% 失败
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.