SFML/examples/shader/resources/pixelate.sfx
2011-05-15 13:37:29 +02:00

11 lines
235 B
Plaintext

uniform sampler2D texture;
uniform vec2 mouse;
void main()
{
float factor = 5.0 + 100.0 * length(mouse);
vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
gl_FragColor = texture2D(texture, pos) * gl_Color;
}