float4 main(float3 pos : POSITION,
			float2 tex0 : TEXCOORD0,
			uniform sampler2D texture,
            uniform float val) : COLOR0
{
	float3 color = tex2D(texture, tex0).rgb;

	float rval = val*0.5;
	float gval = val*0.625;
	float bval = val*0.875;

//	float3 vals = float3(rval*0.9+.05, gval*0.9+.075, bval*0.9+.1);
	float3 vals = float3(rval, gval, bval);

	color = color-fmod(color+vals*0.5, vals);
	//color = color+(vals*0.25);
	//color = color+color;

	return float4(color,1);
}