12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- Shader "Unlit/ShuiLiZi"
- {
- Properties
- {
- _MainColor("MianColor",color) = (1,1,1,1)
- _MainTex ("Texture", 2D) = "white"
- _MoveSpeed("MoveSpeed",Vector) = (0,0,0,0)
- }
- SubShader
- {
- Tags { "Queue" = "Transparent" "RenderType"="Transparent" }
-
- Blend SrcAlpha OneMinusSrcAlpha
- Pass
- {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
-
- #include "UnityCG.cginc"
- struct appdata
- {
- float4 vertex : POSITION;
- float4 uv : TEXCOORD0;
- fixed4 color : COLOR;
- };
- struct v2f
- {
- float4 uv : TEXCOORD0;
- fixed4 color : TEXCOORD1;
- float4 vertex : SV_POSITION;
- };
- sampler2D _MainTex;
- float4 _MainTex_ST;
- fixed4 _MainColor;
- float4 _MoveSpeed;
- v2f vert (appdata v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex);
- o.uv.xy += _Time.y * float2(_MoveSpeed.x, _MoveSpeed.y);
- o.uv.zw = v.uv.zw;
- o.color = v.color;
- return o;
- }
- fixed4 frag (v2f i) : SV_Target
- {
- // sample the texture
- fixed4 col = tex2D(_MainTex, i.uv.xy);
- clip(col.a - i.uv.z);
- col *= _MainColor;
- col *= i.color;
- return col;
- }
- ENDCG
- }
- }
- }
|