uniform sampler2D image;

/*const float integerOne = 1.0 / 255.0;
const float integerTwo = integerOne * 2.0;
const float integerThree = integerOne * 3.0;

const float integer64 = integerOne * 64.0;
const float integer128 = integerOne * 128.0;
const float integer192 = integerOne * 192.0;*/

void main()
{
	vec3 fragment = texture2D(image, gl_TexCoord[0].xy).rgb;
	fragment *= 255.0;
	fragment -= floor(fragment);
	
	//---------------------------LSB------------------------
	//In case those two bits need to be the LSB bits
	/*if (fragment.r < 0.25)
	{
		fragment.r = 0.0;
	}
	else if (fragment.r < 0.5)
	{
		fragment.r = integerOne;
	}
	else if (fragment.r < 0.75)
	{
		fragment.r = integerTwo;
	}
	else
	{
		fragment.r = integerThree;
	}
	
	if (fragment.g < 0.25)
	{
		fragment.g = 0.0;
	}
	else if (fragment.g < 0.5)
	{
		fragment.g = integerOne;
	}
	else if (fragment.g < 0.75)
	{
		fragment.g = integerTwo;
	}
	else
	{
		fragment.g = integerThree;
	}
	
	if (fragment.b < 0.25)
	{
		fragment.b = 0.0;
	}
	else if (fragment.b < 0.5)
	{
		fragment.b = integerOne;
	}
	else if (fragment.b < 0.75)
	{
		fragment.b = integerTwo;
	}
	else
	{
		fragment.b = integerThree;
	}*/
	
	//---------------------------MSB------------------------
	//This is probably not needed
	/*if (fragment.r < 0.25)
	{
		fragment.r = 0.0;
	}
	else if (fragment.r < 0.5)
	{
		fragment.r = integer64;
	}
	else if (fragment.r < 0.75)
	{
		fragment.r = integer128;
	}
	else
	{
		fragment.r = integer192;
	}
	
	if (fragment.g < 0.25)
	{
		fragment.g = 0.0;
	}
	else if (fragment.g < 0.5)
	{
		fragment.g = integer64;
	}
	else if (fragment.g < 0.75)
	{
		fragment.g = integer128;
	}
	else
	{
		fragment.g = integer192;
	}
	
	if (fragment.b < 0.25)
	{
		fragment.b = 0.0;
	}
	else if (fragment.b < 0.5)
	{
		fragment.b = integer64;
	}
	else if (fragment.b < 0.75)
	{
		fragment.b = integer128;
	}
	else
	{
		fragment.b = integer192;
	}*/
	
	gl_FragColor = vec4(fragment, 1.0);
}