카테고리 없음

16-5 알파블렌딩,컷아웃,그림자

소나무꼴 2020. 4. 8. 01:22
Shader "Custom/16-5"
{
    Properties
    {
		_Color ("Main Color", Color) = (1,1,1,1)
		_MainTex("Texture", 2D) = "white" {}
		_Cutoff("Alpha cutoff", Range(0, 1)) = 0.5
    }
    SubShader
    {
		Tags { "RenderType" = "Transparent" "Queue" = "AlphaTest"}
		cull off
		CGPROGRAM
		#pragma surface surf Lambert alphatest:_Cutoff

		struct Input
		{
			float2 uv_MainTex;
		};

		sampler2D _MainTex;

		void surf(Input IN, inout SurfaceOutput o)
		{
			fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
			o.Albedo = c.rgb;
			o.Alpha = c.a;
		}
		ENDCG
    }
    //FallBack "Diffuse"
	Fallback "Legacy Shaders/Transparent/Cutout/VertexLit"
}