aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders/loqsubpixeldistancefieldtext.frag
blob: 61b6c8dd9adc9ddbe6826b621b78b6af046d875c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
varying highp vec3 sampleNearLeft;
varying highp vec3 sampleNearRight;

uniform sampler2D _qt_texture;
uniform lowp vec4 color;
uniform mediump float alphaMin;
uniform mediump float alphaMax;

void main()
{
    highp vec2 n;
    n.x = texture2DProj(_qt_texture, sampleNearLeft).a;
    n.y = texture2DProj(_qt_texture, sampleNearRight).a;
    n = smoothstep(alphaMin, alphaMax, n);
    highp float c = 0.5 * (n.x + n.y);
    gl_FragColor = vec4(n.x, c, n.y, c) * color.w;
}