aboutsummaryrefslogtreecommitdiff
path: root/shaders/circleMask.glsl
blob: 7595ea9b8a51a15183daabf599de4d66d702f84c (plain)
1
2
3
4
5
6
7
8
9
10
uniform sampler2D texture;

void main()
{
    vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);
    vec2 pixelOffset = gl_TexCoord[0].xy - vec2(0.5, 0.5);
    float dist = sqrt(dot(pixelOffset, pixelOffset));
    dist = smoothstep(0.47, 0.5, dist);
    gl_FragColor = gl_Color * pixel * vec4(1.0, 1.0, 1.0, 1.0 - dist);
}