aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders/distancefieldshiftedtext.frag
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/shaders/distancefieldshiftedtext.frag')
-rw-r--r--src/quick/scenegraph/shaders/distancefieldshiftedtext.frag17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/quick/scenegraph/shaders/distancefieldshiftedtext.frag b/src/quick/scenegraph/shaders/distancefieldshiftedtext.frag
new file mode 100644
index 0000000000..60c1c7468b
--- /dev/null
+++ b/src/quick/scenegraph/shaders/distancefieldshiftedtext.frag
@@ -0,0 +1,17 @@
+varying highp vec2 sampleCoord;
+varying highp vec2 shiftedSampleCoord;
+
+uniform sampler2D _qt_texture;
+uniform lowp vec4 color;
+uniform lowp vec4 styleColor;
+uniform mediump float alphaMin;
+uniform mediump float alphaMax;
+
+void main()
+{
+ highp float a = smoothstep(alphaMin, alphaMax, texture2D(_qt_texture, sampleCoord).a);
+ highp vec4 shifted = styleColor * smoothstep(alphaMin,
+ alphaMax,
+ texture2D(_qt_texture, shiftedSampleCoord).a);
+ gl_FragColor = mix(shifted, color, a);
+} \ No newline at end of file