diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-06-09 10:57:35 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-06-15 10:20:21 +0200 |
commit | 90bf30376c94b2fcf99e2d8382b40e8881be47be (patch) | |
tree | fc7dac6b58b45afc7676c7dae82ce36ee78b2542 /src/quick/scenegraph/shaders_ng/compile.bat | |
parent | a8d357761dbf74cbdc72348be6c655cafb745ff2 (diff) |
Anisotropic antialiasing for distance field text
For perspective transforms, we need to find the sample
range in the glyph cache per pixel. We can do this by
getting the gradient of the distance field at the
specific pixel.
This will ensure proper antialiasing with any
projection, but has the limitation that when glyph contours
become thinner than a pixel, they may disappear or become
too emphasized, because the hardware-gradient - based on
neighbouring fragments - is not reliable at that scale.
So we should only default to this when we detect that the
text is child of a 3D scene.
To make this smooth, we need to know the mode of the renderer
when creating the shader. So QSGMaterial::createShader()
now takes a render mode that we can use to customize behavior
based on whether it is rendering into a 2D or 3D scene.
[ChangeLog][QtQuick] The QSGMaterial::createShader() virtual
function has been extended to take a render mode argument,
which can be used for any customizations needed in the case
where the shader will be used in combination with 3D perspective
transformations.
Fixes: QTBUG-84695
Change-Id: I5a18a4edbdfa07e8f9d506c42bb20e8eb580927d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/shaders_ng/compile.bat')
-rwxr-xr-x | src/quick/scenegraph/shaders_ng/compile.bat | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/scenegraph/shaders_ng/compile.bat b/src/quick/scenegraph/shaders_ng/compile.bat index 4e0bce6aff..dd256a751e 100755 --- a/src/quick/scenegraph/shaders_ng/compile.bat +++ b/src/quick/scenegraph/shaders_ng/compile.bat @@ -68,13 +68,19 @@ qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o styledtext.frag.qsb styledt qsb --glsl "150,120,100 es" -o styledtext_a.frag.qsb styledtext_a.frag qsb -b --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldtext.vert.qsb distancefieldtext.vert qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldtext.frag.qsb distancefieldtext.frag +qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldtext_fwidth.frag.qsb distancefieldtext_fwidth.frag qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldtext_a.frag.qsb distancefieldtext_a.frag +qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldtext_a_fwidth.frag.qsb distancefieldtext_a_fwidth.frag qsb -b --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldshiftedtext.vert.qsb distancefieldshiftedtext.vert qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldshiftedtext.frag.qsb distancefieldshiftedtext.frag +qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldshiftedtext_fwidth.frag.qsb distancefieldshiftedtext_fwidth.frag qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldshiftedtext_a.frag.qsb distancefieldshiftedtext_a.frag +qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldshiftedtext_a_fwidth.frag.qsb distancefieldshiftedtext_a_fwidth.frag qsb -b --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldoutlinetext.vert.qsb distancefieldoutlinetext.vert qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldoutlinetext.frag.qsb distancefieldoutlinetext.frag +qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldoutlinetext_fwidth.frag.qsb distancefieldoutlinetext_fwidth.frag qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldoutlinetext_a.frag.qsb distancefieldoutlinetext_a.frag +qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o distancefieldoutlinetext_a_fwidth.frag.qsb distancefieldoutlinetext_a_fwidth.frag qsb -b --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o hiqsubpixeldistancefieldtext.vert.qsb hiqsubpixeldistancefieldtext.vert qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o hiqsubpixeldistancefieldtext.frag.qsb hiqsubpixeldistancefieldtext.frag qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o hiqsubpixeldistancefieldtext_a.frag.qsb hiqsubpixeldistancefieldtext_a.frag |