2009-11-03 17:04:40 +08:00
|
|
|
uniform sampler2D texture;
|
2011-12-10 20:02:38 +08:00
|
|
|
uniform float pixel_threshold;
|
2009-11-03 17:04:40 +08:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2011-12-10 20:02:38 +08:00
|
|
|
float factor = 1.0 / (pixel_threshold + 0.001);
|
2009-11-03 17:04:40 +08:00
|
|
|
vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
|
|
|
|
gl_FragColor = texture2D(texture, pos) * gl_Color;
|
|
|
|
}
|