#ifndef URP_COMMON
#define URP_COMMON
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" 
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"

Light GetMainLight(half3 positionWS)
{
#ifdef _MAIN_LIGHT_SHADOWS
	#if defined(MAIN_LIGHT_CALCULATE_SHADOWS)
		float4 shadowCoord = TransformWorldToShadowCoord(positionWS);
	#else
		float4 shadowCoord = float4(0, 0, 0, 0);
	#endif
	Light light = GetMainLight(shadowCoord);
#else
	Light light = GetMainLight();
#endif			
	return light;
}

half3 DecodeHDR(half4 data)
{
	// Take into account texture alpha if decodeInstructions.w is true(the alpha value affects the RGB channels)
	half alpha = (data.a - 1.0) + 1.0;

	// If Linear mode is not supported we can skip exponent part
#if defined(UNITY_COLORSPACE_GAMMA)
	return (alpha) * data.rgb;
#else
#   if defined(UNITY_USE_NATIVE_HDR)
	return data.rgb; // Multiplier for future HDRI relative to absolute conversion.
#   else
	return (pow(alpha, 1)) * data.rgb;
#   endif
#endif
}


#endif