Shader "Custom/flowcolor" {Properties {_maintex ("Base (RGB)", 2D) = "White" {}_flowcolor ("Flow color", Color) = (1,1,1,1) _flowrange ("Flow Range", Float) = 0.01}subshader {Pass {Tags {" Queue" = "Geometry"}cgprogram #include " Unitycg.cginc "struct v2f{float4 vertex:position;float2 uv:texcoord0;float nr:texcoord1;}; sampler2d _maintex;float4 _flowcolor;float _flowrange;v2f Vert (appdata_base v) {v2f O;o.uv = V.texcoord;o.vertex = Mul (Unity_matrix_mvp,v.vertex); Float2 dir = normalize (float2 (cos (_time.y), sin (_time.y))); Float2 Worldnormal = Normalize (Mul ((float3x3) _object2world,v.normal)). Xz;o.nr = dot (dir,worldnormal); return o; Fixed4 Frag (v2f in): color{//fixed4 c = tex2d (_maintex, IN.UV); fixed FAC = saturate (sign (in.nr * (In.nr-_flowrange))) ; fixed4 c=fac*tex2d (_maintex, IN.UV) + (1-FAC) *_flowcolor;return C;} #pragma vertex vert #pragma fragment FRAGENDCG}} FallBack "Diffuse"}
Unity Shader Model Streamer Effect