#version 330

in float fParticleScale;
in vec2 vTexCoord;
out vec4 OutColor;

uniform vec3 uColor;
uniform float uFogDensity;
uniform vec3 uFogColor;

void main()
{
/*
	vec2 finalCoord = vTexCoord;
	finalCoord.y = 1.0 - finalCoord.y;
	vec4 color = texture( uTexSampler, finalCoord );
	out_Color = color * uColor * fParticleBrightness;
*/
	float intensity = exp( -(length( vec2( 0.5 ) - vTexCoord ) ) * ( fParticleScale * 16.0 ) );
	
	float dist = (gl_FragCoord.z / gl_FragCoord.w);
	float fogFactor = clamp( 1.0 - exp2( -uFogDensity * uFogDensity * dist * dist * 1.44 ), 0.0, 1.0 );
	
	OutColor = vec4( mix( (uColor * intensity) + uFogColor, uFogColor, fogFactor ), intensity );
}
