
#ifndef BLACK_HOLE
#define BLACK_HOLE



//---------------------------------------------Height Fog--------------------------------------------------------
uniform int _G_Black_Hole_Enable;
uniform float4 _G_Black_Hole_Center;
uniform float _G_Black_Hole_ScaleCoef;
uniform float _G_Black_Hole_Intensity;
uniform float _G_Black_Hole_DarkIntensity;

float BalckHole_GetLightIntensity(float3 pos)
{
	return 1;

	if (_G_Black_Hole_Enable == 0)
		return 1;

	float d = distance(pos, _G_Black_Hole_Center.xyz);
	d = d - _G_Black_Hole_Center.w;
	d = max(0, d);
	//d = 1.0 / (_G_Black_Hole_ScaleCoef * sqrt(2.0 * 3.1415926)) * exp(-d * d / (2.0 * _G_Black_Hole_ScaleCoef * _G_Black_Hole_ScaleCoef));
	d = 1.0 / (_G_Black_Hole_ScaleCoef * 2.505993) * exp(-d * d / (2.0 * _G_Black_Hole_ScaleCoef * _G_Black_Hole_ScaleCoef));
	d *= _G_Black_Hole_Intensity;
	d += _G_Black_Hole_DarkIntensity;
	return d;
}

#endif // BLACK_HOLE