#ifndef __COLOR_DEPENDENCY_HLSL__
#define __COLOR_DEPENDENCY_HLSL__

namespace Color
{
	static float GammaCorrectionValue = 2.2;

	float RGBToLuminance(float3 color)
	{
		return dot(color, float3(0.2125, 0.7154, 0.0721));
	}

	float RGBToLuminanceAlternative(float3 color)
	{
		return dot(color, float3(0.3, 0.59, 0.11));
	}

	float RGBToLuminance2(float3 color)
	{
		return dot(color, float3(0.299, 0.587, 0.114));
	}

	const static float AlbedoPreMult = 1 / 1.7;                         // greater value -> brighter pbr
	const static float LightPreMult = 1 / (3.1415926 * AlbedoPreMult);  // ensure 1/PI as product

	float3 GammaToLinear(float3 color)
	{
		return pow(abs(color), 2.2);
	}

	float3 LinearToGamma(float3 color)
	{
		return pow(abs(color), 1.0 / 2.2);
	}
}

#endif  //__COLOR_DEPENDENCY_HLSL__