diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-11-27 10:58:56 +0100 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-11-27 10:58:56 +0100 |
commit | 9df70b0304fa44d2f1b1504d7e58d718eab4343a (patch) | |
tree | 95a7b207a39c2b44bd4e80bcc1ea3d36bedd9a99 /src/quick/scenegraph/shaders/loqsubpixeldistancefieldtext.frag | |
parent | 648d4ae6a3591e916f175e32c12a2ea4f8edb6a9 (diff) | |
parent | 900e3d4ad5f2bc4994ddf164c15c641f85630b81 (diff) |
Merge branch 'stable' into dev
Conflicts:
.qmake.conf
Change-Id: I10d4f9e993d23750a6e8ddc1291b79e47fc83c64
Diffstat (limited to 'src/quick/scenegraph/shaders/loqsubpixeldistancefieldtext.frag')
-rw-r--r-- | src/quick/scenegraph/shaders/loqsubpixeldistancefieldtext.frag | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/quick/scenegraph/shaders/loqsubpixeldistancefieldtext.frag b/src/quick/scenegraph/shaders/loqsubpixeldistancefieldtext.frag new file mode 100644 index 0000000000..61b6c8dd9a --- /dev/null +++ b/src/quick/scenegraph/shaders/loqsubpixeldistancefieldtext.frag @@ -0,0 +1,17 @@ +varying highp vec3 sampleNearLeft; +varying highp vec3 sampleNearRight; + +uniform sampler2D _qt_texture; +uniform lowp vec4 color; +uniform mediump float alphaMin; +uniform mediump float alphaMax; + +void main() +{ + highp vec2 n; + n.x = texture2DProj(_qt_texture, sampleNearLeft).a; + n.y = texture2DProj(_qt_texture, sampleNearRight).a; + n = smoothstep(alphaMin, alphaMax, n); + highp float c = 0.5 * (n.x + n.y); + gl_FragColor = vec4(n.x, c, n.y, c) * color.w; +}
\ No newline at end of file |