Last active
December 4, 2018 03:04
-
-
Save sbmjob/145dba9b6216507c015e3f701f16a16d to your computer and use it in GitHub Desktop.
Custom Shader AlphaTest for Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/AlphaTest_ForWeb" { | |
Properties { | |
_MainTex ("Albedo (RGB)", 2D ) = "white" {} | |
_Cutoff ("Cutoff" , Range(0, 1)) = 0.5 | |
} | |
SubShader { | |
Tags { | |
"Queue" = "AlphaTest" | |
"RenderType" = "TransparentCutout" | |
} | |
LOD 200 | |
Cull Off | |
CGPROGRAM | |
#pragma target 3.0 | |
#pragma surface surf Standard fullforwardshadows alphatest:_Cutoff | |
sampler2D _MainTex; | |
struct Input { | |
float2 uv_MainTex; | |
}; | |
void surf (Input IN, inout SurfaceOutputStandard o) { | |
fixed2 scrolledUV = IN.uv_MainTex; | |
fixed yScrollValue = 1.0 * _Time;//縦 | |
scrolledUV += fixed2(0,yScrollValue); | |
fixed4 c = tex2D (_MainTex, scrolledUV); | |
o.Albedo = c.rgb; | |
o.Alpha = c.a; | |
} | |
ENDCG | |
} | |
FallBack "Transparent/Cutout/Diffuse" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment