float4 main(float3 pos : POSITION,
			float2 tex0 : TEXCOORD0,
            uniform sampler2D texture, uniform float bri, uniform float strength) : COLOR0
{
	float3 color = tex2D(texture, tex0);
	float3 origcolor = color;
	float treshold = 0.5;
	float power = 2;

	// calculate some funny 'grey value'. 1 == colorful, 0 == totally bland
	float coloris = (abs(color.r-color.g) + abs(color.r-color.b) + abs(color.g-color.b)) * 0.5;
	float grey = ( color.r + color.b + color.g ) * 0.333333;

	color.r = (1-(1-grey)*(1-grey))*0.3+grey*0.7;
	color.g = (1-(1-grey)*(1-grey))*0.3+grey*0.7;
	color.b = (1-(1-grey)*(1-grey))*0.3+grey*0.7;

	color.r = ( color.r*(1-strength) + origcolor.r*origcolor.r*(strength)*0.5 + 0.75*origcolor.r*(strength) ) *bri;
	color.g = ( color.g*(1-strength) + origcolor.g*origcolor.g*(strength)*0.5 + 0.75*origcolor.g*(strength) ) *bri;
	color.b = ( color.b*(1-strength) + origcolor.b*origcolor.b*(strength)*0.5 + 0.75*origcolor.b*(strength) ) *bri;

	if(color.r>1) color.r = 1;
	if(color.g>1) color.g = 1;
	if(color.b>1) color.b = 1;

	return float4(color,1);
}