Shader "HiddenURP/Character/Outline" 
{
	Properties
	{
		_Color("Main Color", Color) = (1,1,1,1)
		_ColorParam("Main ColorParam", Color) = (1,1,1,1)
		_MainTex("Texture", 2D) = "white" {}

		_MaskTex("Mask", 2D) = "black" {}
		_LightMaskTex("LightMask", 2D) = "black" {}
		_LightMaskParam("_LightMaskParam", Range(0.0,1.0)) = 0.7
		_LightMaskBackParam("_LightMaskBackParam", Range(0.0,1.0)) = 0.7
		_RampTex("Ramp", 2D) = "white"{}
		_RampColor("Ramp Color", Color) = (1,1,1,1)

		_HighLight("HighLight",range(0,1)) = 0.9		// 高光范围
		_HighLightColor("HighLight Color", Color) = (1,1,1,1)
		_HighLightStrength("HighLightStrength", range(0,1000)) = 5
		_BrightnessFactor("MinBrightness", range(0, 1)) = 0
		_BrightnessColor("Brightness Color", Color) = (1,1,1,1)

		_LightInfo("LightInfo", Vector) = (0.9, -1, 0.5, 0.005)
		_LightColor("LightColor",color) = (1,1,1,1)

		
		_RampFactor("RampFactor", range(0,3)) = 2.5
		_RampFactor1("RampFactor1", range(0.1,20)) = 3

		_BrightnessRatio("Brightness Ratio", range(0,10)) = 0
		_BrightnessIncrease("Brightness Increase", range(0,10)) = 4

		_FlashTex("FlashTex", 2D) = "black" {}
		_FlashFactor("FlashFactor", Vector) = (0, -2, 1, 1)
		_FlashMixedColor("FlashMixedColor",Color) = (0.4,0.2,0,1)
		_FlashStrength("FlashStrength", Range(0, 5)) = 1
		_FlashMixedColorAdd("FlashMixedColorAdd",Color) = (0.4,0.2,0,1)
		_FlashStrengthAdd("FlashStrengthAdd", Range(0, 5)) = 1
		_FlashSpeed("FlashSpeed", Range(0, 5)) = 0.2

		_ShadowTex("Shadow (RGB) Trans (A)", 2D) = "white" {}
		_DirX("DirX", Range(0,5)) = 0.5
		_DirY("DirY", Range(0,5)) = 0.5
		[Toggle]_IsRotate("IsRotate", Range(0,1)) = 0
		_Speed("Speed", Range(-1,1)) = 0.1
		_ShadowAlphaRatio("ShadowAlphaRatio", Range(0.5,1.5)) = 1
		_Transparency("Transparency", range(0,1)) = 1

		[Toggle]_NewRamp("NewRamp", Range(0,1)) = 0

		[Toggle]_IsColoration("Is Coloration", Range(0,1)) = 0
		_Coloration("Coloration Color", color) = (1.1,1,1)

		_Outline("Outline Thickness", range(0,10)) = 0.35

		_DissolveTex("DissolveTex", 2D) = "white" {}
		_DissolveFactor("DissolveFactor",Range(0, 1)) = 0
	}
	SubShader
	{
		Tags
		{
			"IgnoreProjector" = "true"
			"RenderType"="Opaque"
			"Queue"="Geometry"
		}

		//UsePass "URP/Toon/Char/Basic/CHAR_BASIC"

		//描边
		pass
		{
			Name "CHAR_OUTLINE"
			Tags{ "LightMode" = "SRPDefaultUnlit" }
			Lighting Off
			Cull Front
			ZTest Less
			ColorMask RGBA
			//Blend SrcAlpha OneMinusSrcAlpha

			HLSLPROGRAM
			#pragma vertex OutlineVert
			#pragma fragment OutlineFrag
			#pragma shader_feature _Tangent
			#pragma multi_compile _Change
			//#pragma shader_feature _USE_Ramp_Num4
			#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
			#pragma shader_feature Receive_Shadows
			#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
			#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
			#pragma multi_compile _ _SHADOWS_SOFT
			//#pragma shader_feature FLASH_SWITCH
			#pragma multi_compile DISSOLVE
			#include "HLSLToon.hlsl"
			#include "HLSLOutlineInc.hlsl"
			#pragma target 3.0

			ENDHLSL
		}		
		pass
		{
			Name "CHAR_PBROUTLINE"
			Tags{ "LightMode" = "SRPDefaultUnlit" }
			Lighting Off
			Cull Front
			ZTest Less
			ColorMask RGBA
			//Blend SrcAlpha OneMinusSrcAlpha

			HLSLPROGRAM
			#pragma vertex OutlineVert
			#pragma fragment OutlineFrag
			#pragma shader_feature _Tangent
			#pragma multi_compile _Change
			#pragma shader_feature _NORMALMAP
			#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
			#pragma shader_feature Receive_Shadows
			#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
			#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
			#pragma multi_compile _ _SHADOWS_SOFT
			//#pragma shader_feature FLASH_SWITCH
			#pragma multi_compile DISSOLVE
			#pragma shader_feature _ENVIRONMENTREFLECTIONS_OFF
			#include "HLSLPbrToon.hlsl"
			#include "HLSLOutlineInc.hlsl"
			#pragma target 3.0

			ENDHLSL
		}		
	}
	//CustomEditor "Valkyrie.OutlineShaderGUI"
}