blob: 79f88683ff739e4f37dfdf5bfc917c7b1f6f57fd (
plain)
1
2
3
4
5
6
7
8
9
|
uniform sampler2D texture;
uniform float pixel_threshold;
void main()
{
float factor = 1.0 / (pixel_threshold + 0.001);
vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
gl_FragColor = texture2D(texture, pos) * gl_Color;
}
|