Hello everyone, recently we have optimize some legacy codes, include legacy shaders which we need to use. However these shaders is failed to functional in Unity 2017, and the error message as followings:
Shader error in ‘test’: Parse error: syntax error, unexpected TVAL_ID, expecting TOK_SETTEXTURE or ‘}’ at line 11
We know that fix function shaders is not recommend since Unity 5.x, but these code should be kept for some reason, what could we do?
The shader code is as following.
Shader "Tut/Shader/Common/AlphaTest_alpha_0"
{
Properties {
_DstTex ("DstTex", 2D) ="white"{}
_SrcTex ("SrcTex", 2D) ="white"{}
_CutOff ("Cut Off", Float) =0.5
}
SubShader {
Pass{
AlphaTest Off
SetTexture[_DstTex] { combine texture alpha }
}
Pass {
AlphaTest Always [_CutOff]
SetTexture [_SrcTex] { combine texture alpha }
}
}
}