    SubShader
    {
        Tags {*LIL_SUBSHADER_TAGS*}
        HLSLINCLUDE
            #pragma target 3.5
            #pragma fragmentoption ARB_precision_hint_fastest
            #define LIL_GEM
            #define LIL_MULTI
            #define LIL_MULTI_INPUTS_EMISSION
            #define LIL_MULTI_INPUTS_EMISSION_2ND
            #define LIL_MULTI_INPUTS_NORMAL
            #define LIL_MULTI_INPUTS_NORMAL_2ND
            #define LIL_MULTI_INPUTS_ANISOTROPY
            #define LIL_MULTI_INPUTS_MATCAP
            #define LIL_MULTI_INPUTS_MATCAP_2ND
            #define LIL_MULTI_INPUTS_RIM
            #define LIL_MULTI_INPUTS_GLITTER
            #define LIL_MULTI_INPUTS_AUDIOLINK
            #define LIL_MULTI_INPUTS_DISSOLVE
            #define LIL_MULTI_INPUTS_IDMASK
            #define LIL_MULTI_INPUTS_UDIMDISCARD

            #pragma lil_skip_variants_shadows
            #pragma lil_skip_variants_decals
            #pragma lil_skip_variants_addlightshadows
            #pragma lil_skip_variants_probevolumes
            #pragma lil_skip_variants_ao
        ENDHLSL

        // GrabPass
        GrabPass {"_lilBackgroundTexture"}

        *LIL_INSERT_PASS_PRE*

        // Forward Pre
        Pass
        {
            Name "FORWARD_PRE"
            Tags {"LightMode" = "*LIL_LIGHTMODE_FORWARD_0*"}
            Stencil
            {
                Ref [_StencilRef]
                ReadMask [_StencilReadMask]
                WriteMask [_StencilWriteMask]
                Comp [_StencilComp]
                Pass [_StencilPass]
                Fail [_StencilFail]
                ZFail [_StencilZFail]
            }
            Cull [_Cull]
            ZWrite [_ZWrite]
            Blend One Zero, Zero One
            AlphaToMask [_AlphaToMask]
            HLSLPROGRAM

            //----------------------------------------------------------------------------------------------------------------------
            // Build Option
            #pragma vertex vert
            #pragma fragment frag
            #pragma multi_compile_instancing

            //----------------------------------------------------------------------------------------------------------------------
            // Pass
            #define LIL_GEM_PRE
            #include "Includes/lil_pipeline_brp.hlsl"
            #include "Includes/lil_common.hlsl"
            // Insert functions and includes that depend on Unity here
            *LIL_SUBSHADER_INSERT*

            #include "Includes/lil_pass_forward_gem.hlsl"

            *LIL_SUBSHADER_INSERT_POST*
            ENDHLSL
        }

        // Forward
        Pass
        {
            Name "FORWARD"
            Tags {"LightMode" = "*LIL_LIGHTMODE_FORWARD_1*"}

            Stencil
            {
                Ref [_StencilRef]
                ReadMask [_StencilReadMask]
                WriteMask [_StencilWriteMask]
                Comp [_StencilComp]
                Pass [_StencilPass]
                Fail [_StencilFail]
                ZFail [_StencilZFail]
            }
            Cull [_Cull]
            ZClip [_ZClip]
            ZWrite [_ZWrite]
            ZTest [_ZTest]
            ColorMask [_ColorMask]
            Offset [_OffsetFactor], [_OffsetUnits]
            BlendOp [_BlendOp], [_BlendOpAlpha]
            Blend [_SrcBlend] [_DstBlend], [_SrcBlendAlpha] [_DstBlendAlpha]
            AlphaToMask [_AlphaToMask]

            HLSLPROGRAM

            //----------------------------------------------------------------------------------------------------------------------
            // Build Option
            #pragma vertex vert
            #pragma fragment frag
            #pragma lil_multi_compile_forward

            // AlphaMask and Dissolve
            #pragma shader_feature_local GEOM_TYPE_BRANCH_DETAIL

            // Main
            #pragma shader_feature_local GEOM_TYPE_FROND
            #pragma shader_feature_local _EMISSION
            #pragma shader_feature_local GEOM_TYPE_BRANCH
            #pragma shader_feature_local _SUNDISK_SIMPLE
            #pragma shader_feature_local _NORMALMAP
            #pragma shader_feature_local EFFECT_BUMP
            #pragma shader_feature_local SOURCE_GBUFFER
            #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
            #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF
            #pragma shader_feature_local GEOM_TYPE_MESH
            #pragma shader_feature_local _METALLICGLOSSMAP
            #pragma shader_feature_local GEOM_TYPE_LEAF
            #pragma shader_feature_local _SPECGLOSSMAP
            #pragma shader_feature_local _MAPPING_6_FRAMES_LAYOUT
            #pragma shader_feature_local _SUNDISK_HIGH_QUALITY

            // Replace keywords
            #include "Includes/lil_replace_keywords.hlsl"

            //----------------------------------------------------------------------------------------------------------------------
            // Pass
            #include "Includes/lil_pipeline_brp.hlsl"
            #include "Includes/lil_common.hlsl"
            // Insert functions and includes that depend on Unity here
            *LIL_SUBSHADER_INSERT*

            #include "Includes/lil_pass_forward_gem.hlsl"

            *LIL_SUBSHADER_INSERT_POST*
            ENDHLSL
        }

        // ShadowCaster
        Pass
        {
            Name "SHADOW_CASTER"
            Tags {"LightMode" = "ShadowCaster"}

            Stencil
            {
                Ref [_StencilRef]
                ReadMask [_StencilReadMask]
                WriteMask [_StencilWriteMask]
                Comp [_StencilComp]
                Pass [_StencilPass]
                Fail [_StencilFail]
                ZFail [_StencilZFail]
            }
            Offset 1, 1
            Cull [_Cull]

            HLSLPROGRAM

            //----------------------------------------------------------------------------------------------------------------------
            // Build Option
            #pragma vertex vert
            #pragma fragment frag
            #pragma lil_multi_compile_shadowcaster

            // AlphaMask and Dissolve
            #pragma shader_feature_local GEOM_TYPE_BRANCH_DETAIL

            // Replace keywords
            #include "Includes/lil_replace_keywords.hlsl"

            //----------------------------------------------------------------------------------------------------------------------
            // Pass
            #include "Includes/lil_pipeline_brp.hlsl"
            #include "Includes/lil_common.hlsl"
            // Insert functions and includes that depend on Unity here
            *LIL_SUBSHADER_INSERT*

            #include "Includes/lil_pass_shadowcaster.hlsl"

            *LIL_SUBSHADER_INSERT_POST*
            ENDHLSL
        }

        // Meta
        Pass
        {
            Name "META"
            Tags {"LightMode" = "Meta"}
            Cull Off

            HLSLPROGRAM

            //----------------------------------------------------------------------------------------------------------------------
            // Build Option
            #pragma vertex vert
            #pragma fragment frag
            #pragma lil_multi_compile_meta

            // Tone correction and emission
            #pragma shader_feature_local _EMISSION
            #pragma shader_feature_local GEOM_TYPE_BRANCH
            #pragma shader_feature_local _SUNDISK_SIMPLE

            // Replace keywords
            #include "Includes/lil_replace_keywords.hlsl"

            //----------------------------------------------------------------------------------------------------------------------
            // Pass
            #include "Includes/lil_pipeline_brp.hlsl"
            #include "Includes/lil_common.hlsl"
            // Insert functions and includes that depend on Unity here
            *LIL_SUBSHADER_INSERT*

            #include "Includes/lil_pass_meta.hlsl"

            *LIL_SUBSHADER_INSERT_POST*
            ENDHLSL
        }

        *LIL_INSERT_PASS_POST*
    }
    Fallback "Unlit/Texture"