#version 120
varying vec2 uv;

uniform sampler2D textureSampler;
uniform float cellThreshold;

void main() {
	vec4 texColor = texture2D(textureSampler, uv).rgba;
	texColor.rgb = floor(texColor.rgb * cellThreshold + 0.5) / cellThreshold;
	gl_FragColor = texColor;
}