如题spa
搞了很久,一直报错:code
Shader error in 'custom_outline_effect': Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or '}' at line 69blog
只要是把 #pragma surface ... 写在 Pass中就算出错,这种状况只要不写 Pass{} 中就好了,由于会自动生成的class
1 Pass { // 这样写会报错,使用 surface 不须要写在 Pass 中 2 CGPROGRAM 3 #pragma surface surf Lambert 4 5 sampler2D _MainTex; 6 7 struct Input { 8 float2 uv_MainTex; 9 }; 10 11 void surf (Input IN, inout SurfaceOutput o) { 12 half4 c = tex2D (_MainTex, IN.uv_MainTex); 13 o.Albedo = c.rgb; 14 o.Alpha = c.a; 15 } 16 ENDCG 17 }