1. 실행 이미지
2. Material

Shader "Custom/blink"
{
    Properties
    {
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _MaskTex("Albedo (RGB)", 2D) = "white" {}
        _RampTex("Ramp Texture",2D) = "white" {}


    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 200

        CGPROGRAM
        #pragma surface surf Standard fullforwardshadows
        #pragma target 3.0

        sampler2D _MainTex;
        sampler2D _MaskTex;
        sampler2D _RampTex;

        struct Input
        {
            float2 uv_MainTex;
        };


        void surf (Input IN, inout SurfaceOutputStandard o)
        {
            fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
            float4 maskColor = tex2D(_MaskTex, IN.uv_MainTex);
            float4 rampColor = tex2D(_RampTex, float2(_Time.y,0.5));
            o.Albedo = c.rgb;
            o.Emission = c.rgb * maskColor.g * rampColor.r;
            o.Alpha = c.a;
        }
        ENDCG
    }
    FallBack "Diffuse"
}

3. blink (Shader)

반응형

+ Recent posts