summaryrefslogtreecommitdiff
path: root/src/effects/shaders/+glslcore/displace.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/displace.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/displace.frag')
-rw-r--r--src/effects/shaders/+glslcore/displace.frag29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/effects/shaders/+glslcore/displace.frag b/src/effects/shaders/+glslcore/displace.frag
deleted file mode 100644
index 0a1ba7c..0000000
--- a/src/effects/shaders/+glslcore/displace.frag
+++ /dev/null
@@ -1,29 +0,0 @@
-#version 150 core
-in vec2 qt_TexCoord0;
-uniform float qt_Opacity;
-uniform sampler2D source;
-uniform sampler2D displacementSource;
-uniform float displacement;
-uniform float xPixel;
-uniform float yPixel;
-out vec4 fragColor;
-
-float linearstep(float e0, float e1, float x) {
- return clamp((x - e0) / (e1 - e0), 0.0, 1.0);
-}
-
-void main() {
- vec4 offset = texture(displacementSource, qt_TexCoord0);
- offset.xy -= vec2(0.5, 0.5);
- offset.xy = offset.xy * step(vec2(1.0/256.0), abs(offset.xy));
- vec2 tx = qt_TexCoord0 + (vec2(-offset.x, offset.y) * displacement);
-
- float e1 = linearstep(0.0, xPixel, tx.x);
- float e2 = linearstep(0.0, yPixel, tx.y);
- float e3 = 1.0 - linearstep(1.0, 1.0 + xPixel, tx.x);
- float e4 = 1.0 - linearstep(1.0, 1.0 + yPixel, tx.y);
-
- vec4 sample = texture(source, tx);
- sample.rgb *= e1 * e2 * e3 * e4;
- fragColor = sample * qt_Opacity * offset.a;
-}