美文网首页Unity教程合集Unity Shader分享
Shader:两套uv结合顶点着色

Shader:两套uv结合顶点着色

作者: Wwnje | 来源:发表于2017-08-24 10:06 被阅读0次
WX20170824-100520@2x.png
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结合顶点着色

    本文链接:https://www.haomeiwen.com/subject/iimsdxtx.html