Shader "URP/Effects/Particle/AdditiveColor Mask Camp_G" {
    Properties {
        [HDR]_TintColor ("Color", Color) = (0.5,0.5,0.5,1)
        _MainTex ("MainTex", 2D) = "white" {}
        _USpeed01 ("U Speed 01", Float ) = 0
        _VSpeed01 ("V Speed 01", Float ) = 0
        _02Tex ("02Tex", 2D) = "white" {}
        _USpeed02 ("U Speed 02", Float ) = 0
        _VSpeed02 ("V Speed 02", Float ) = 0
        _Power ("Power", Range(0, 10)) = 1
        _Mask ("Mask", 2D) = "white" {}
        [MaterialToggle] _Camp ("Camp", Float ) = 0.5
        _EnemyColor ("EnemyColor", Color) = (1,0,0,1)
        [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
    }
    SubShader {
        Tags {
            "IgnoreProjector"="True"
            "Queue"="Transparent"
            "RenderType"="Transparent"
        }
        Pass {
            Name "FORWARD"
            // Tags {
            //     "LightMode"="ForwardBase"
            // }
            Blend SrcAlpha One
            Cull Off
            ZWrite Off
            
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #define UNITY_PASS_FORWARDBASE
            #include "UnityCG.cginc"
            #pragma multi_compile_fwdbase
             
            #pragma target 3.0
            uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
            uniform float4 _TintColor;
            uniform float _USpeed01;
            uniform float _VSpeed01;
            uniform sampler2D _02Tex; uniform float4 _02Tex_ST;
            uniform float _USpeed02;
            uniform float _VSpeed02;
            uniform sampler2D _Mask; uniform float4 _Mask_ST;
            uniform fixed _Camp;
            uniform float4 _EnemyColor;
            uniform float _Power;
            struct VertexInput {
                float4 vertex : POSITION;
                float2 texcoord0 : TEXCOORD0;
                float4 vertexColor : COLOR;
            };
            struct VertexOutput {
                float4 pos : SV_POSITION;
                float2 uv0 : TEXCOORD0;
                float4 vertexColor : COLOR;
            };
            VertexOutput vert (VertexInput v) {
                VertexOutput o = (VertexOutput)0;
                o.uv0 = v.texcoord0;
                o.vertexColor = v.vertexColor;
                o.pos = UnityObjectToClipPos( v.vertex );
                return o;
            }
            float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
                float isFrontFace = ( facing >= 0 ? 1 : 0 );
                float faceSign = ( facing >= 0 ? 1 : -1 );
////// Lighting:
                float4 node_2388 = _Time;
                float2 node_2628 = (i.uv0+(node_2388.g*float2(_USpeed01,_VSpeed01)));
                float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(node_2628, _MainTex));
                float2 node_3434 = (i.uv0+(node_2388.g*float2(_USpeed02,_VSpeed02)));
                float4 _02Tex_var = tex2D(_02Tex,TRANSFORM_TEX(node_3434, _02Tex));
                float4 _Mask_var = tex2D(_Mask,TRANSFORM_TEX(i.uv0, _Mask));
                float3 finalColor = (_MainTex_var.rgb*_02Tex_var.rgb*_Power*(lerp( _TintColor.rgb, _EnemyColor.rgb, _Camp )*i.vertexColor.rgb)*_Mask_var.r);
                return fixed4(finalColor,(_MainTex_var.a*i.vertexColor.a*_TintColor.a*_EnemyColor.a));
            }
            ENDCG
        }
    }
    //CustomEditor "ShaderForgeMaterialInspector"
}
