Unity Shader Marge - PullRequest
       8

Unity Shader Marge

0 голосов
/ 11 декабря 2018

Мне нужна помощь в объединении двух шейдеров со стандартным шейдером.Когда я делаю это, я получаю так много ошибок (я начинающий в шейдерах)

Стандартный шейдер: https://pastebin.com/dqd4qQg2

SHADER 1

Shader "XRay Shaders/Diffuse-Stencil-Write"

{Properties {_Color ("Основной цвет", Цвет) = (1,1,1,1) _MainTex ("База (RGB)", 2D) = "белый" {}}

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

    Stencil
    {
        Ref 1
        Comp Always
        Pass Replace
        ZFail Keep
    }

    CGPROGRAM
    #pragma surface surf Lambert

    sampler2D _MainTex;
    fixed4 _Color;

    struct Input {
        float2 uv_MainTex;
    };

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

Fallback "Legacy Shaders/VertexLit"

}

SHADER 2

Шейдер "XRay Shaders / Diffuse-XRay-Replaceable" {Properties {_Color ("Основной цвет", Цвет) = (1,1,1,1) _EdgeColor ("XRay Edge Color", Color) = (0,0,0,0) _MainTex (" Base (RGB) ", 2D) =" white "{}}

SubShader
{
    Tags
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////////
        // In some cases, it's necessary to force XRay objects to render before the rest of the geometry    //
        // This is so their depth info is already in the ZBuffer, and Occluding objects won't mistakenly    //
        // write to the Stencil buffer when they shouldn't.                                                 //
        //                                                                                                  //
        // This is what "Queue" = "Geometry-1" is for.                                                      //
        // I didn't bring this up in the video because I'm an idiot.                                        //
        //                                                                                                  //
        // Cheers,                                                                                          //
        // Dan                                                                                              //
        //////////////////////////////////////////////////////////////////////////////////////////////////////
        "Queue" = "Geometry-1"
        "RenderType" = "Opaque"
        "XRay" = "ColoredOutline"
    }
    LOD 200

    CGPROGRAM
    #pragma surface surf Lambert

    sampler2D _MainTex;
    fixed4 _Color;

    struct Input {
        float2 uv_MainTex;
    };

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

Fallback "Legacy Shaders/VertexLit"

}

...