Shader/Shader - SurfaceShader

18-2

소나무꼴 2020. 4. 15. 16:22
Shader "Custom/18-2"
{
    Properties
    {
		_MainTex("Texture", 2D) = "white" {}
		_MaskTex("Mask", 2D) = "white" {}
		_RampTex("Ramp", 2D) = "white" {}
    }
    SubShader
    {
		Tags { "RenderType" = "Qpaque"}
		
		CGPROGRAM
		#pragma surface surf Lambert
		sampler2D _MainTex;
		sampler2D _MaskTex;
		sampler2D _RampTex;
		struct Input
		{
			float2 uv_MainTex;
			float2 uv_MaskTex;
			float2 uv_RampTex;
		};
		void surf(Input IN, inout SurfaceOutput o)
		{
			fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
			fixed4 m = tex2D(_MaskTex, IN.uv_MaskTex);
			fixed4 r = tex2D(_RampTex, float2(_Time.y *0.1, 0.5));
			o.Albedo = c.rgb;
			o.Emission = c.rgb * m.r * r.r;
			o.Alpha = 1;
		}
		ENDCG

    }
    FallBack "Diffuse"
}

'Shader > Shader - SurfaceShader' 카테고리의 다른 글

18-4 풀흔들기  (0) 2020.04.22
18-3타들어가는  (0) 2020.04.15
18-1-2Pass Alpha  (0) 2020.04.15
17-1알파블렌딩  (0) 2020.04.15
16-3-알파블렌딩  (0) 2020.04.08