Shader "Grass/GrassBlade" {
    Properties {
        [KeywordEnum(LOD 0, LOD 1, LOD 2)] _LOD("Level of Detail", int) = 0
        _BladeWidth("Breite", Range(0.003, .1)) = 0.01
        _BendStrength("Bend Strength", Range(0, 1)) = 1
    }
    SubShader {
        LOD 100
        Cull Off

        //Render Pass
        Pass {
            Tags { "LightMode" = "ForwardBase"}
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma geometry geom

            #pragma multi_compile _ SHADOWS_SCREEN
            // shader_feature is very similar to multi_compile. Use multi_compile for keywords that are set from code.
            #pragma shader_feature _LOD_LOD_0 _LOD_LOD_1 _LOD_LOD_2

            #include "UnityCG.cginc"
            #include "UnityPBSLighting.cginc"
            #include "AutoLight.cginc"

            #include "./include/Random.hlsl"
            #include "./include/Math.hlsl"
            #include "./include/Culling.hlsl"
            #include "./include/GrassHelpers.hlsl"

            #define IS_IN_BASE_PASS

            #include "./include/GrassBladePass.hlsl"

            ENDCG
        }

        // Shadow Pass
        Pass {
            Tags { "LightMode" = "ShadowCaster" }
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma geometry geom
            
            #pragma shader_feature _LOD_LOD_0 _LOD_LOD_1 _LOD_LOD_2

            #include "UnityCG.cginc"

            #include "./include/Random.hlsl"
            #include "./include/Math.hlsl"
            #include "./include/Culling.hlsl"
            #include "./include/GrassHelpers.hlsl"
            
            #define IS_IN_SHADOW_PASS

            #include "./include/GrassBladePass.hlsl"

            ENDCG
        }
    }
}
