It is strongly recommended to try reading this article first and then solve it yourself: https://zhuanlan.zhihu.com/p/360566324
I will record my thoughts here:
- First check whether the URP upgrade is correct, mainly to see whether the Asset is set and whether the ShaderGraph behaves normally.
- Try to rule out whether the problem is caused by undefined macros, mainly comparing the code automatically generated by ShaderGraph.
- Confirm whether your code uses HLSLPROGRAM (this must be used in URP, if you don’t use the Shader you wrote, it is actually the Build-In pipeline)
- There cannot be fixed in the code! ! ! , there cannot be cginc files! ! ! , very important, it is fixed. Even if you do not use CGPROGRAM, it will default to you using it, which will cause the definition in the build-in pipeline to be referenced by default, thus triggering redefinition.