【日常记录】Unity3D 中的 Surface Shader 是不支持在 Pass中使用的

时间:2017-07-30 10:56:32   收藏:0   阅读:3497

如题

搞了好久,一直报错:

Shader error in ‘custom_outline_effect‘: Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or ‘}‘ at line 69

只要是把 #pragma surface ... 写在 Pass中就算出错

 1         Pass { // Pass 中无法使用 surface 渲染模式,也就是说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         }

 

原文:http://www.cnblogs.com/night-ride-depart/p/7258307.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!