如题
搞了好久,一直报错:
Shader error in 'custom_outline_effect': Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or '}' at line 69
只要是把 #pragma surface ... 写在 Pass中就算出错,这种情况只要不写 Pass{} 中就行了,因为会自动生成的
Pass { // 这样写会报错,使用 surface 不需要写在 Pass 中
CGPROGRAM
#pragma surface surf Lambert sampler2D _MainTex; struct Input {
float2 uv_MainTex;
}; void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}