unity3d - vert: function return value missing semantics -
i trying running code unity site
shader "unityexample/vertex , fragment/3-behind bars" { subshader{ pass{ cgprogram #pragma vertex vert #pragma fragment frag #include "unitycg.cginc" struct vertout{ float4 pos: sv_position; float4 scrpos; }; vertout vert(appdata_base v){ vertout o; o.pos = mul(unity_matrix_mvp, v.vertex); o.scrpos = computescreenpos(o.pos); return o; } fixed4 frag(vertout i) : sv_target{ float2 wcoord = (i.scrpos.xy/i.scrpos.w); fixed4 color; if(fmod(20.0 * wcoord.x,2.0)<1.0){ color = fixed4(wcoord.xy,0.0,1.0); } else{ color = fixed4(0.3,0.3,0.3,1.0); } return color; } endcg } } }
this code showing me error on line
vertout vert(appdata_base v)
vert: function return value missing semantics
i using unity 4.6
semantics missing scrpos.
float4 scrpos : texcoord0;
Comments
Post a Comment