diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-06-16 08:23:28 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-06-18 07:13:40 +0200 |
commit | 286cb9d4021f46e51162b30c4336fe52555f1756 (patch) | |
tree | 6bd0458e3e6159d3915f6a4409fc95cd29354725 | |
parent | 90ed1ba80a610713bd0eca8377a3f0f40293cf29 (diff) |
Revert accidentally changed outline shaders
The standard outline shaders were accidentally changed to
use fwidth() as part of 90bf30376c94b2fcf99e2d8382b40e8881be47be.
The same change adds specialized outline shaders when fwidth
is enabled, so the change to the default ones can simply be
reverted.
Task-number: QTBUG-84695
Change-Id: I45c3e234d1ddb39f968967cce28906f352b237ea
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag.qsb | bin | 2097 -> 2097 bytes | |||
-rw-r--r-- | src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag.qsb | bin | 2101 -> 2109 bytes |
4 files changed, 6 insertions, 8 deletions
diff --git a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag index 64bd21221e..c8c1ac89dc 100644 --- a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag +++ b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag @@ -19,8 +19,7 @@ layout(std140, binding = 0) uniform buf { void main() { - float distance = texture(_qt_texture, sampleCoord).r; - float f = fwidth(distance); - fragColor = mix(ubuf.styleColor, ubuf.color, smoothstep(0.5 - f, 0.5 + f, distance)) - * smoothstep(ubuf.outlineAlphaMax0, ubuf.outlineAlphaMax1, distance); + float d = texture(_qt_texture, sampleCoord).r; + fragColor = mix(ubuf.styleColor, ubuf.color, smoothstep(ubuf.alphaMin, ubuf.alphaMax, d)) + * smoothstep(ubuf.outlineAlphaMax0, ubuf.outlineAlphaMax1, d); } diff --git a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag.qsb b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag.qsb Binary files differindex 67716f03c1..aebbee40b3 100644 --- a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag.qsb +++ b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext.frag.qsb diff --git a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag index 68dc4a2867..70fb80852d 100644 --- a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag +++ b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag @@ -19,8 +19,7 @@ layout(std140, binding = 0) uniform buf { void main() { - float distance = texture(_qt_texture, sampleCoord).a; - float f = fwidth(distance); - fragColor = mix(ubuf.styleColor, ubuf.color, smoothstep(0.5 - f, 0.5 + f, distance)) - * smoothstep(ubuf.outlineAlphaMax0, ubuf.outlineAlphaMax1, distance); + float d = texture(_qt_texture, sampleCoord).a; + fragColor = mix(ubuf.styleColor, ubuf.color, smoothstep(ubuf.alphaMin, ubuf.alphaMax, d)) + * smoothstep(ubuf.outlineAlphaMax0, ubuf.outlineAlphaMax1, d); } diff --git a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag.qsb b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag.qsb Binary files differindex 403e425f60..c57f8a4099 100644 --- a/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag.qsb +++ b/src/quick/scenegraph/shaders_ng/distancefieldoutlinetext_a.frag.qsb |