Shader:两套uv结合顶点着色

Shader "Mobile/doubleUVDiffuse" {
    Properties{
        _MainTex("Base (RGB)", 2D) = "white" {}
    _MainTex2("Base (RGB)", 2D) = "white" {}
    }
        SubShader{
        Tags{ "RenderType" = "Opaque" }
        LOD 150

        CGPROGRAM
#pragma surface surf Lambert vertex:vert

        sampler2D _MainTex;
    sampler2D _MainTex2;

    struct Input {
        float2 uv_MainTex;
        float2 uv2_MainTex2;
        float4 vertColor;
    };

    void vert(inout appdata_full v, out Input o)
    {
        UNITY_INITIALIZE_OUTPUT(Input,o);
        o.vertColor = v.color;
    }

    void surf(Input IN, inout SurfaceOutput o) {
        fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
        fixed4 c2 = tex2D(_MainTex2, IN.uv2_MainTex2);
        o.Albedo = c.rgb* c2.rgb * IN.vertColor.rgb;
        o.Alpha = c.a;
    }
    ENDCG
    }

        Fallback "Mobile/VertexLit"
}

你可能感兴趣的:(Shader:两套uv结合顶点着色)