unity
config_error
ai_generated
true
Shader error in 'Universal Render Pipeline/Lit': failed to open source file at line 0. The current render pipeline is not compatible with this shader.
ID: unity/urp-shader-pipeline-mismatch
95%Fix Rate
90%Confidence
1Evidence
2023-06-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Unity 2022.3 | active | — | — | — |
| URP 14.0.8 | active | — | — | — |
| Built-in RP | active | — | — | — |
Root Cause
The material or shader is designed for URP but the project is using Built-in Render Pipeline, or vice versa.
generic中文
材质或着色器是为URP设计的,但项目使用的是内置渲染管线,反之亦然。
Official Documentation
https://docs.unity3d.com/Packages/[email protected]/manual/upgrading-your-shaders.htmlWorkarounds
-
95% success Convert the project to URP via Window > Render Pipeline > Universal Render Pipeline > Upgrade Project Materials to URP Materials, or manually assign a URP-compatible shader like 'Universal Render Pipeline/Lit'.
Convert the project to URP via Window > Render Pipeline > Universal Render Pipeline > Upgrade Project Materials to URP Materials, or manually assign a URP-compatible shader like 'Universal Render Pipeline/Lit'.
-
90% success If staying on Built-in RP, replace the material's shader with a Built-in equivalent like 'Standard' via the material inspector.
If staying on Built-in RP, replace the material's shader with a Built-in equivalent like 'Standard' via the material inspector.
中文步骤
通过Window > Render Pipeline > Universal Render Pipeline > Upgrade Project Materials to URP Materials将项目转换为URP,或手动分配URP兼容的着色器,如'Universal Render Pipeline/Lit'。
如果保留在内置渲染管线上,通过材质检查器将材质的着色器替换为内置等效项,如'Standard'。
Dead Ends
Common approaches that don't work:
-
80% fail
Simply changing the shader name in the material inspector does not update the underlying shader code; it may still reference URP-specific functions.
-
70% fail
Deleting and re-importing the shader file does not fix the pipeline incompatibility; the shader must be rewritten for the correct pipeline.