SFML/bindings/dotnet/examples/shader/resources/pixelate.sfx

11 lines
231 B
Plaintext
Raw Normal View History

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