aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders/distancefieldoutlinetext_core.frag
blob: 622e353019fc3ea7c10bb5ffcc1b2cf0bd48b386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#version 150 core

in vec2 sampleCoord;

out vec4 fragColor;

uniform sampler2D _qt_texture;
uniform vec4 color;
uniform vec4 styleColor;
uniform float alphaMin;
uniform float alphaMax;
uniform float outlineAlphaMax0;
uniform float outlineAlphaMax1;

void main()
{
    float d = texture(_qt_texture, sampleCoord).r;
    float a = smoothstep(alphaMin, alphaMax, d);
    fragColor = (1.0 - a) * styleColor * smoothstep(outlineAlphaMax0, outlineAlphaMax1, d);
}