diff options
author | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-05-03 15:31:34 +0300 |
---|---|---|
committer | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-05-06 11:15:27 +0000 |
commit | 655c1952563a31179fefb46eb178caa662bc3bee (patch) | |
tree | 6596fd66d209d65cf6e54777226425c3b83fb21b /src/Runtime/res/effectlib/distancefieldtext.vert | |
parent | e40d5ffa94622c316ff89bc4a0515c804cb2570e (diff) |
Implement fixes to the distance field renderer
- Change modelView matrix to mvp for sharper texts
- Support global opacity from parents
- Allow changing alpha from the text color picker
- Change shadow color to be the same as the text color
Task-number: QT3DS-3343
Task-number: QT3DS-3363
Change-Id: I37178abe6c9239619a3f9de440d2b9245a138a82
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Runtime/res/effectlib/distancefieldtext.vert')
-rw-r--r-- | src/Runtime/res/effectlib/distancefieldtext.vert | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Runtime/res/effectlib/distancefieldtext.vert b/src/Runtime/res/effectlib/distancefieldtext.vert index a3feb378..01024c6b 100644 --- a/src/Runtime/res/effectlib/distancefieldtext.vert +++ b/src/Runtime/res/effectlib/distancefieldtext.vert @@ -1,5 +1,4 @@ uniform highp mat4 mvp; -uniform highp mat4 modelView; uniform highp float fontScale; uniform int textureWidth; uniform int textureHeight; @@ -59,7 +58,7 @@ highp float determinant(highp mat4 m) void main() { - highp float scale = fontScale * sqrt(abs(determinant(modelView))); + highp float scale = fontScale * sqrt(abs(determinant(mvp))); alphas = alphaRange(scale); sampleCoord = tCoord * vec2(1.0 / highp float(textureWidth), 1.0 / highp float(textureHeight)); gl_Position = mvp * vec4(vCoord, 1.0); |