aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders/distancefieldshiftedtext_core.frag
blob: 3f66965e789968a18b482434ccd99e0735b47b77 (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;
in vec2 shiftedSampleCoord;

out vec4 fragColor;

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

void main()
{
    float a = smoothstep(alphaMin, alphaMax, texture(_qt_texture, sampleCoord).r);
    vec4 shifted = styleColor * smoothstep(alphaMin, alphaMax,
                                           texture(_qt_texture, shiftedSampleCoord).r);
    fragColor = mix(shifted, color, a);
}