Unity Web Shader IDE
Full source <URP>/Shaders/2D/Mesh2D-Unlit-Default.shader ShaderLab / HLSL 69 lines 9 symbols 2 includes Hide source Show source
Mesh2D-Unlit-Default.shader <URP>/Shaders/2D/Mesh2D-Unlit-Default.shader
Language
ShaderLab / HLSL
Lines
69
Symbols
9
Includes
2
Open IDE root

<URP>/Shaders/2D/Mesh2D-Unlit-Default.shader full source

Shader "Universal Render Pipeline/2D/Mesh2D-Unlit-Default"
{
    Properties
    {
        _MainTex("Diffuse", 2D) = "white" {}
        [HideInInspector] _White("Tint", Color) = (1,1,1,1)  // Added to break SRP batching. Work around for issue with SRP Batching
    }

    SubShader
    {
        Tags {"Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }

        Stencil
        {
            Ref 128                // Put this in the last bit of our stencil value for maximum compatibility with sprite mask
            Comp always
            Pass replace
        }

        Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
        Cull Back
        ZWrite On

        Pass
        {
            Stencil
            {
                Ref 128                // Put this in the last bit of our stencil value for maximum compatibility with sprite mask
                Comp always
                Pass replace
            }

            HLSLPROGRAM
            #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"

            #pragma vertex UnlitVertex
            #pragma fragment UnlitFragment

            // GPU Instancing
            #pragma multi_compile_instancing

            struct Attributes
            {
                COMMON_2D_INPUTS
            };

            struct Varyings
            {
                COMMON_2D_OUTPUTS
            };
                
            float4 _White;

            #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/2DCommon.hlsl"

            Varyings UnlitVertex(Attributes input)
            {
                return CommonUnlitVertex(input);
            }

            half4 UnlitFragment(Varyings input) : SV_Target
            {
                return CommonUnlitFragment(input, _White);
            }
            ENDHLSL
        }
    }
}