varying vec2 v_vTexcoord;

void main()
{
	vec3 OldColor = vec3(texture2D(gm_BaseTexture, v_vTexcoord));
	vec3 NewColor = OldColor;
	
	if (OldColor.r >= 0. && OldColor.r < 0.2) {
		NewColor = vec3(0.2, 0.2, 0.2);
	}
	else if (OldColor.r >= 0.2 && OldColor.r < 0.4) {
		NewColor = vec3(0.4, 0.4, 0.4);
	}
	else if (OldColor.r >= 0.4) {
		NewColor = vec3(1., 1., 1.);
	}
	/*if (OldColor.r == 0.) {
		NewColor = vec3(0.2, 0.2, 0.2);
	}
	else if (OldColor.r == 0.2) {
		NewColor = vec3(0.4, 0.4, 0.4);
	}
	else if (OldColor.r == 0.4) {
		NewColor = vec3(1., 1., 1.);
	}*/
	
	gl_FragColor = vec4(vec3(NewColor), 1.);
}
