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