这是由于Input中定义的材质uv变量过多,当前版本的shader model不支持造成的。
将shader model改为更高的版本即可解决。比如我现在用的#pragma target 3.0不支持3个材质,改为#pragma target 4.0就行了。
如果非要用#pragma target 3.0,只能通过共用uv_MainTex或者使用屏幕坐标来解决了。
参考:
Your shaders model target does not support that many texture interpolators. You can specify a higher shader model target using #pragma target <shader model>
, for example #pragma target 4.0
, or you could try to simplify your shader so it fits in target 2.0 or 3.0.
By default, Unity compiles shaders into roughly shader model 2.0 equivalent.
#pragma target 4.0 - compile to DX10 shader model 4.0.
This target is currently only supported by DirectX 11 and XboxOne/PS4 platforms.
Note that all OpenGL-like platforms (including mobile) are treated as “capable of shader model 3.0”. WP8/WinRT platforms (DX11 feature level 9.x) are treated as only capable of shader model 2.0.