Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/Animation_00" {
- Properties {
- _MainTex ("Albedo (RGB)", 2D) = "white" {}
- _OnePictureLength("onePictureLength",float) = 0.1667
- _Cutoff("alpha",range(0,1))=0.5
- }
- SubShader {
- Tags { "RenderType"="Opaque" "Queue"="Transparent"}
- //AlphaTest Greater [_alpha]
- ZWrite off
- blend SrcAlpha OneMinusSrcAlpha
- LOD 200
- CGPROGRAM
- #pragma surface surf Lambert alphatest:_Cutoff
- sampler2D _MainTex;
- int i;
- float _OnePictureLength;
- struct Input {
- float2 uv_MainTex;
- };
- void surf (Input IN, inout SurfaceOutput o)
- {
- // 四捨五入
- i = round(_Time.w);
- float2 uv = IN.uv_MainTex;
- // 填入 1/圖片數量數字,看是橫的或是直的。
- uv *= float2(_OnePictureLength,1);
- uv += float2(i*_OnePictureLength,0);
- fixed4 c = tex2D (_MainTex, uv);
- o.Albedo = c.rgb;
- o.Alpha = c.a;
- }
- ENDCG
- }
- FallBack "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement