summaryrefslogtreecommitdiff
path: root/src/effects/shaders/+glslcore/fastmaskedblur.frag
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-06-06 18:49:07 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-09 10:58:44 +0200
commit1a819c0ca5744d3537944126ff013686d5efbffe (patch)
tree89d55d7f662244b564c77047861b5ef015d10556 /src/effects/shaders/+glslcore/fastmaskedblur.frag
parentb7e24192352bee955d37a89fc061f1dafd32b73a (diff)
downloadqtgraphicaleffects-1a819c0ca5744d3537944126ff013686d5efbffe.tar.gz
Port 17 effects to RHI, remove 8 unportable ones
The following are based on static shader code, and after porting the shaders they will work fully identically to 5.15: FastBlur Colorize OpacityMask BrightnessContrast ColorOverlay Desaturate Displace GammaAdjust HueSaturation LevelAdjust RectangularGlow Thresholdmask LinearGradient RadialGradient ConicalGradient The following change behavior: Glow DropShadow These now only have the fast variants, because those rely on static shader code. So we are going back to the Qt 5.5 versions and make them behave as if 'fast' was always set to true. The 'fast' and 'samples' properties are removed. The following are removed: Blend GaussianBlur DirectionalBlur MaskedBlur RadialBlur RecursiveBlur ZoomBlur InnerShadow The autotest and the gallery application (run qmlscene testBed.qml in tests/manual/testbed) have been adjusted accordingly and now work across all QRhi backends. The docs may still refer to removed effects in some code snippets. Updating that is left as a separate exercise. [ChangeLog] Graphical Effects no longer relies on dynamically generated shader strings. The following effects have been removed: Blend, GaussianBlur, MaskedBlur, RadialBlur, RecursiveBlur, ZoomBlur, InnerShadow. Glow and DropShadow always use the 'fast' variant. The fast and samples properties for these are thus no longer applicable and have been removed. Change-Id: Ife83f3828f37977596fd34f8da8b61961f0ed28a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/effects/shaders/+glslcore/fastmaskedblur.frag')
-rw-r--r--src/effects/shaders/+glslcore/fastmaskedblur.frag53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/effects/shaders/+glslcore/fastmaskedblur.frag b/src/effects/shaders/+glslcore/fastmaskedblur.frag
deleted file mode 100644
index ae4d628..0000000
--- a/src/effects/shaders/+glslcore/fastmaskedblur.frag
+++ /dev/null
@@ -1,53 +0,0 @@
-#version 150 core
-uniform sampler2D mask;
-uniform sampler2D source1;
-uniform sampler2D source2;
-uniform sampler2D source3;
-uniform sampler2D source4;
-uniform sampler2D source5;
-uniform sampler2D source6;
-uniform float lod;
-uniform float qt_Opacity;
-in vec2 qt_TexCoord0;
-out vec4 fragColor;
-
-float weight(float v) {
- if (v <= 0.0)
- return 1.0;
-
- if (v >= 0.5)
- return 0.0;
-
- return 1.0 - v * 2.0;
-}
-
-void main() {
-
- vec4 maskColor = texture(mask, qt_TexCoord0);
- float l = lod * maskColor.a;
-
- float w1 = weight(abs(l - 0.100));
- float w2 = weight(abs(l - 0.300));
- float w3 = weight(abs(l - 0.500));
- float w4 = weight(abs(l - 0.700));
- float w5 = weight(abs(l - 0.900));
- float w6 = weight(abs(l - 1.100));
-
- float sum = w1 + w2 + w3 + w4 + w5 + w6;
- float weight1 = w1 / sum;
- float weight2 = w2 / sum;
- float weight3 = w3 / sum;
- float weight4 = w4 / sum;
- float weight5 = w5 / sum;
- float weight6 = w6 / sum;
-
- vec4 sourceColor = texture(source1, qt_TexCoord0) * weight1;
- sourceColor += texture(source2, qt_TexCoord0) * weight2;
- sourceColor += texture(source3, qt_TexCoord0) * weight3;
- sourceColor += texture(source4, qt_TexCoord0) * weight4;
- sourceColor += texture(source5, qt_TexCoord0) * weight5;
- sourceColor += texture(source6, qt_TexCoord0) * weight6;
-
- fragColor = sourceColor * qt_Opacity;
-
-}