// (C) by Kirk Barnes, some changes by Berserker
void BrightnessContrastSaturation(inout vec3 color, in vec3 modifier)
{
	const vec3 LumCoeff = vec3(0.2125, 0.7154, 0.0721);
	const vec3 AvgLumin = vec3(0.5);

	vec3 brtColor = color * modifier.r;			// modifier.r = brightness
	vec3 intensity = vec3(dot(brtColor, LumCoeff));
	vec3 satColor = mix(intensity, brtColor, modifier.b);	// modifier.b = saturation
	color = mix(AvgLumin, satColor, modifier.g);		// modifier.g = contrast
}
