aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/shaders/distancefieldtext_core.frag
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/shaders/distancefieldtext_core.frag')
-rw-r--r--src/quick/scenegraph/shaders/distancefieldtext_core.frag16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/quick/scenegraph/shaders/distancefieldtext_core.frag b/src/quick/scenegraph/shaders/distancefieldtext_core.frag
new file mode 100644
index 0000000000..9c64a60d3d
--- /dev/null
+++ b/src/quick/scenegraph/shaders/distancefieldtext_core.frag
@@ -0,0 +1,16 @@
+#version 150 core
+
+in vec2 sampleCoord;
+
+out vec4 fragColor;
+
+uniform sampler2D _qt_texture;
+uniform vec4 color;
+uniform float alphaMin;
+uniform float alphaMax;
+
+void main()
+{
+ fragColor = color * smoothstep(alphaMin, alphaMax,
+ texture(_qt_texture, sampleCoord).r);
+} \ No newline at end of file