diff options
author | Alexandru Croitor <[email protected]> | 2021-08-12 11:24:12 +0200 |
---|---|---|
committer | Alexandru Croitor <[email protected]> | 2021-08-12 17:51:01 +0200 |
commit | 425911d07fc8c3bb899226a1355c38a166b5e1de (patch) | |
tree | 1d5e0e5ae3ec66b10920bb9104e7d12c69b4a52f /src/effects/shaders_ng | |
parent | 59ab3e11433a5157aac0f3af7c0d7fe70a373373 (diff) |
Add a README.md mentioning the documentation on where the ported
effects can be found, as well as how to check out the Qt5 branch.
Pick-to: 6.2
Fixes: QTBUG-95757
Change-Id: Ib47c7e73f8622c8e287df0f74c6f16a5113b357e
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'src/effects/shaders_ng')
49 files changed, 0 insertions, 839 deletions
diff --git a/src/effects/shaders_ng/brightnesscontrast.frag b/src/effects/shaders_ng/brightnesscontrast.frag deleted file mode 100644 index c9ae173..0000000 --- a/src/effects/shaders_ng/brightnesscontrast.frag +++ /dev/null @@ -1,26 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - float brightness; - float contrast; -}; - -layout(binding = 1) uniform sampler2D source; - -void main() -{ - vec4 pixelColor = texture(source, qt_TexCoord0); - pixelColor.rgb /= max(1.0/256.0, pixelColor.a); - float c = 1.0 + contrast; - float contrastGainFactor = 1.0 + c * c * c * c * step(0.0, contrast); - pixelColor.rgb = ((pixelColor.rgb - 0.5) * (contrastGainFactor * contrast + 1.0)) + 0.5; - pixelColor.rgb = mix(pixelColor.rgb, vec3(step(0.0, brightness)), abs(brightness)); - fragColor = vec4(pixelColor.rgb * pixelColor.a, pixelColor.a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/brightnesscontrast.frag.qsb b/src/effects/shaders_ng/brightnesscontrast.frag.qsb Binary files differdeleted file mode 100644 index 2fc9761..0000000 --- a/src/effects/shaders_ng/brightnesscontrast.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/colorize.frag b/src/effects/shaders_ng/colorize.frag deleted file mode 100644 index a109a45..0000000 --- a/src/effects/shaders_ng/colorize.frag +++ /dev/null @@ -1,72 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - float hue; - float saturation; - float lightness; -}; - -layout(binding = 1) uniform sampler2D source; - -float RGBtoL(vec3 color) -{ - float cmin = min(color.r, min(color.g, color.b)); - float cmax = max(color.r, max(color.g, color.b)); - float l = (cmin + cmax) / 2.0; - return l; -} - -float hueToIntensity(float v1, float v2, float h) -{ - h = fract(h); - if (h < 1.0 / 6.0) - return v1 + (v2 - v1) * 6.0 * h; - else if (h < 1.0 / 2.0) - return v2; - else if (h < 2.0 / 3.0) - return v1 + (v2 - v1) * 6.0 * (2.0 / 3.0 - h); - - return v1; -} - -vec3 HSLtoRGB(vec3 color) -{ - float h = color.x; - float l = color.z; - float s = color.y; - - if (s < 1.0 / 256.0) - return vec3(l, l, l); - - float v1; - float v2; - if (l < 0.5) - v2 = l * (1.0 + s); - else - v2 = (l + s) - (s * l); - - v1 = 2.0 * l - v2; - - float d = 1.0 / 3.0; - float r = hueToIntensity(v1, v2, h + d); - float g = hueToIntensity(v1, v2, h); - float b = hueToIntensity(v1, v2, h - d); - return vec3(r, g, b); -} - -void main() -{ - vec4 samp = texture(source, qt_TexCoord0); - samp = vec4(samp.rgb / max(1.0/256.0, samp.a), samp.a); - float light = RGBtoL(samp.rgb); - float c = step(0.0, lightness); - samp.rgb = HSLtoRGB(vec3(hue, saturation, mix(light, c, abs(lightness)))); - fragColor = vec4(samp.rgb * samp.a, samp.a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/colorize.frag.qsb b/src/effects/shaders_ng/colorize.frag.qsb Binary files differdeleted file mode 100644 index eb55cb3..0000000 --- a/src/effects/shaders_ng/colorize.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/coloroverlay.frag b/src/effects/shaders_ng/coloroverlay.frag deleted file mode 100644 index 5ec1666..0000000 --- a/src/effects/shaders_ng/coloroverlay.frag +++ /dev/null @@ -1,20 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - vec4 color; -}; - -layout(binding = 1) uniform sampler2D source; - -void main() -{ - vec4 pixelColor = texture(source, qt_TexCoord0); - fragColor = vec4(mix(pixelColor.rgb/max(pixelColor.a, 0.00390625), color.rgb/max(color.a, 0.00390625), color.a) * pixelColor.a, pixelColor.a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/coloroverlay.frag.qsb b/src/effects/shaders_ng/coloroverlay.frag.qsb Binary files differdeleted file mode 100644 index e1eb955..0000000 --- a/src/effects/shaders_ng/coloroverlay.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/compile.bat b/src/effects/shaders_ng/compile.bat deleted file mode 100644 index 9eafc03..0000000 --- a/src/effects/shaders_ng/compile.bat +++ /dev/null @@ -1,77 +0,0 @@ -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: -:: Copyright (C) 2020 The Qt Company Ltd. -:: Contact: https://www.qt.io/licensing/ -:: -:: This file is part of the Qt Graphical Effects module of the Qt Toolkit. -:: -:: $QT_BEGIN_LICENSE:BSD$ -:: Commercial License Usage -:: Licensees holding valid commercial Qt licenses may use this file in -:: accordance with the commercial license agreement provided with the -:: Software or, alternatively, in accordance with the terms contained in -:: a written agreement between you and The Qt Company. For licensing terms -:: and conditions see https://www.qt.io/terms-conditions. For further -:: information use the contact form at https://www.qt.io/contact-us. -:: -:: BSD License Usage -:: Alternatively, you may use this file under the terms of the BSD license -:: as follows: -:: -:: "Redistribution and use in source and binary forms, with or without -:: modification, are permitted provided that the following conditions are -:: met: -:: * Redistributions of source code must retain the above copyright -:: notice, this list of conditions and the following disclaimer. -:: * Redistributions in binary form must reproduce the above copyright -:: notice, this list of conditions and the following disclaimer in -:: the documentation and/or other materials provided with the -:: distribution. -:: * Neither the name of The Qt Company Ltd nor the names of its -:: contributors may be used to endorse or promote products derived -:: from this software without specific prior written permission. -:: -:: -:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -:: "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -:: LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -:: A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -:: OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -:: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -:: LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -:: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -:: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -:: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -:: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -:: -:: $QT_END_LICENSE$ -:: -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::/ - -:: For HLSL we invoke fxc.exe (-c argument) and store the resulting intermediate format -:: instead of HLSL source, so this needs to be run on Windows from a developer command prompt. - -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o opacitymask.frag.qsb opacitymask.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o opacitymask_invert.frag.qsb opacitymask_invert.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o fastblur.frag.qsb fastblur.frag -qsb -b --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o fastblur_internal.vert.qsb fastblur_internal.vert -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o fastblur_internal.frag.qsb fastblur_internal.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o fastglow.frag.qsb fastglow.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o colorize.frag.qsb colorize.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o brightnesscontrast.frag.qsb brightnesscontrast.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o coloroverlay.frag.qsb coloroverlay.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o desaturate.frag.qsb desaturate.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o displace.frag.qsb displace.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o gammaadjust.frag.qsb gammaadjust.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o huesaturation.frag.qsb huesaturation.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o rectangularglow.frag.qsb rectangularglow.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o thresholdmask.frag.qsb thresholdmask.frag -qsb -b --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o lineargradient.vert.qsb lineargradient.vert -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o lineargradient_nomask.frag.qsb lineargradient_nomask.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o lineargradient_mask.frag.qsb lineargradient_mask.frag -qsb -b --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o radialgradient.vert.qsb radialgradient.vert -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o radialgradient_nomask.frag.qsb radialgradient_nomask.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o radialgradient_mask.frag.qsb radialgradient_mask.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o conicalgradient_nomask.frag.qsb conicalgradient_nomask.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o conicalgradient_mask.frag.qsb conicalgradient_mask.frag -qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o leveladjust.frag.qsb leveladjust.frag diff --git a/src/effects/shaders_ng/conicalgradient_mask.frag b/src/effects/shaders_ng/conicalgradient_mask.frag deleted file mode 100644 index 5c1f2ed..0000000 --- a/src/effects/shaders_ng/conicalgradient_mask.frag +++ /dev/null @@ -1,25 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - vec2 center; - float startAngle; -}; - -layout(binding = 1) uniform sampler2D gradientSource; -layout(binding = 2) uniform sampler2D maskSource; - -void main() -{ - float maskAlpha = texture(maskSource, qt_TexCoord0).a; - const float PI = 3.14159265; - const float PIx2inv = 0.1591549; - float a = (atan((center.y - qt_TexCoord0.t), (center.x - qt_TexCoord0.s)) + PI - startAngle) * PIx2inv; - fragColor = texture(gradientSource, vec2(0.0, fract(a))) * maskAlpha * qt_Opacity; -} diff --git a/src/effects/shaders_ng/conicalgradient_mask.frag.qsb b/src/effects/shaders_ng/conicalgradient_mask.frag.qsb Binary files differdeleted file mode 100644 index f0ce8e7..0000000 --- a/src/effects/shaders_ng/conicalgradient_mask.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/conicalgradient_nomask.frag b/src/effects/shaders_ng/conicalgradient_nomask.frag deleted file mode 100644 index b63d7e6..0000000 --- a/src/effects/shaders_ng/conicalgradient_nomask.frag +++ /dev/null @@ -1,23 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - vec2 center; - float startAngle; -}; - -layout(binding = 1) uniform sampler2D gradientSource; - -void main() -{ - const float PI = 3.14159265; - const float PIx2inv = 0.1591549; - float a = (atan((center.y - qt_TexCoord0.t), (center.x - qt_TexCoord0.s)) + PI - startAngle) * PIx2inv; - fragColor = texture(gradientSource, vec2(0.0, fract(a))) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/conicalgradient_nomask.frag.qsb b/src/effects/shaders_ng/conicalgradient_nomask.frag.qsb Binary files differdeleted file mode 100644 index d074e61..0000000 --- a/src/effects/shaders_ng/conicalgradient_nomask.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/desaturate.frag b/src/effects/shaders_ng/desaturate.frag deleted file mode 100644 index b54b3ac..0000000 --- a/src/effects/shaders_ng/desaturate.frag +++ /dev/null @@ -1,21 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - float desaturation; -}; - -layout(binding = 1) uniform sampler2D source; - -void main(void) -{ - vec4 textureColor = texture(source, qt_TexCoord0.st); - float grayColor = (textureColor.r + textureColor.g + textureColor.b) / 3.0; - fragColor = mix(textureColor, vec4(vec3(grayColor), textureColor.a), desaturation) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/desaturate.frag.qsb b/src/effects/shaders_ng/desaturate.frag.qsb Binary files differdeleted file mode 100644 index 8a0b4da..0000000 --- a/src/effects/shaders_ng/desaturate.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/displace.frag b/src/effects/shaders_ng/displace.frag deleted file mode 100644 index df6bc78..0000000 --- a/src/effects/shaders_ng/displace.frag +++ /dev/null @@ -1,39 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - float displacement; - float xPixel; - float yPixel; -}; - -layout(binding = 1) uniform sampler2D source; -layout(binding = 2) uniform sampler2D displacementSource; - -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 samp = texture(source, tx); - samp.rgb *= e1 * e2 * e3 * e4; - fragColor = samp * qt_Opacity * offset.a; -} diff --git a/src/effects/shaders_ng/displace.frag.qsb b/src/effects/shaders_ng/displace.frag.qsb Binary files differdeleted file mode 100644 index 3c3656c..0000000 --- a/src/effects/shaders_ng/displace.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/fastblur.frag b/src/effects/shaders_ng/fastblur.frag deleted file mode 100644 index 6e2ca14..0000000 --- a/src/effects/shaders_ng/fastblur.frag +++ /dev/null @@ -1,32 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - float weight1; - float weight2; - float weight3; - float weight4; - float weight5; -}; - -layout(binding = 1) uniform sampler2D source1; -layout(binding = 2) uniform sampler2D source2; -layout(binding = 3) uniform sampler2D source3; -layout(binding = 4) uniform sampler2D source4; -layout(binding = 5) uniform sampler2D source5; - -void main() -{ - 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; - fragColor = sourceColor * qt_Opacity; -} diff --git a/src/effects/shaders_ng/fastblur.frag.qsb b/src/effects/shaders_ng/fastblur.frag.qsb Binary files differdeleted file mode 100644 index 24c623a..0000000 --- a/src/effects/shaders_ng/fastblur.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/fastblur_internal.frag b/src/effects/shaders_ng/fastblur_internal.frag deleted file mode 100644 index 7a608de..0000000 --- a/src/effects/shaders_ng/fastblur_internal.frag +++ /dev/null @@ -1,25 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 1) in vec2 qt_TexCoord1; -layout(location = 2) in vec2 qt_TexCoord2; -layout(location = 3) in vec2 qt_TexCoord3; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; - float xStep; - float yStep; -}; - -layout(binding = 1) uniform sampler2D source; - -void main() -{ - vec4 sourceColor = (texture(source, qt_TexCoord0) + - texture(source, qt_TexCoord1) + - texture(source, qt_TexCoord2) + - texture(source, qt_TexCoord3)) * 0.25; - fragColor = sourceColor * qt_Opacity; -} diff --git a/src/effects/shaders_ng/fastblur_internal.frag.qsb b/src/effects/shaders_ng/fastblur_internal.frag.qsb Binary files differdeleted file mode 100644 index fd439c8..0000000 --- a/src/effects/shaders_ng/fastblur_internal.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/fastblur_internal.vert b/src/effects/shaders_ng/fastblur_internal.vert deleted file mode 100644 index e9a14b0..0000000 --- a/src/effects/shaders_ng/fastblur_internal.vert +++ /dev/null @@ -1,27 +0,0 @@ -#version 440 - -layout(location = 0) in vec4 qt_Vertex; -layout(location = 1) in vec2 qt_MultiTexCoord0; - -layout(location = 0) out vec2 qt_TexCoord0; -layout(location = 1) out vec2 qt_TexCoord1; -layout(location = 2) out vec2 qt_TexCoord2; -layout(location = 3) out vec2 qt_TexCoord3; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; - float xStep; - float yStep; -}; - -out gl_PerVertex { vec4 gl_Position; }; - -void main() -{ - qt_TexCoord0 = vec2(qt_MultiTexCoord0.x + xStep, qt_MultiTexCoord0.y + yStep * 0.36); - qt_TexCoord1 = vec2(qt_MultiTexCoord0.x + xStep * 0.36, qt_MultiTexCoord0.y - yStep); - qt_TexCoord2 = vec2(qt_MultiTexCoord0.x - xStep * 0.36, qt_MultiTexCoord0.y + yStep); - qt_TexCoord3 = vec2(qt_MultiTexCoord0.x - xStep, qt_MultiTexCoord0.y - yStep * 0.36); - gl_Position = qt_Matrix * qt_Vertex; -} diff --git a/src/effects/shaders_ng/fastblur_internal.vert.qsb b/src/effects/shaders_ng/fastblur_internal.vert.qsb Binary files differdeleted file mode 100644 index 96781b8..0000000 --- a/src/effects/shaders_ng/fastblur_internal.vert.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/fastglow.frag b/src/effects/shaders_ng/fastglow.frag deleted file mode 100644 index fa19239..0000000 --- a/src/effects/shaders_ng/fastglow.frag +++ /dev/null @@ -1,40 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - vec4 color; - float spread; - float weight1; - float weight2; - float weight3; - float weight4; - float weight5; -}; - -layout(binding = 1) uniform sampler2D source1; -layout(binding = 2) uniform sampler2D source2; -layout(binding = 3) uniform sampler2D source3; -layout(binding = 4) uniform sampler2D source4; -layout(binding = 5) uniform sampler2D source5; - -float linearstep(float e0, float e1, float x) -{ - return clamp((x - e0) / (e1 - e0), 0.0, 1.0); -} - -void main() -{ - 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 = mix(vec4(0), color, linearstep(0.0, spread, sourceColor.a)); - fragColor = sourceColor * qt_Opacity; -} diff --git a/src/effects/shaders_ng/fastglow.frag.qsb b/src/effects/shaders_ng/fastglow.frag.qsb Binary files differdeleted file mode 100644 index d78cd6d..0000000 --- a/src/effects/shaders_ng/fastglow.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/gammaadjust.frag b/src/effects/shaders_ng/gammaadjust.frag deleted file mode 100644 index 0a1175a..0000000 --- a/src/effects/shaders_ng/gammaadjust.frag +++ /dev/null @@ -1,22 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - float gamma; -}; - -layout(binding = 1) uniform sampler2D source; - -void main() -{ - vec4 originalColor = texture(source, qt_TexCoord0.st); - originalColor.rgb = originalColor.rgb / max(1.0/256.0, originalColor.a); - vec3 adjustedColor = pow(originalColor.rgb, vec3(gamma)); - fragColor = vec4(adjustedColor * originalColor.a, originalColor.a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/gammaadjust.frag.qsb b/src/effects/shaders_ng/gammaadjust.frag.qsb Binary files differdeleted file mode 100644 index 40ab6c1..0000000 --- a/src/effects/shaders_ng/gammaadjust.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/huesaturation.frag b/src/effects/shaders_ng/huesaturation.frag deleted file mode 100644 index 0b1e10e..0000000 --- a/src/effects/shaders_ng/huesaturation.frag +++ /dev/null @@ -1,91 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - vec3 hsl; -}; - -layout(binding = 1) uniform sampler2D source; - -vec3 RGBtoHSL(vec3 color) -{ - float cmin = min(color.r, min(color.g, color.b)); - float cmax = max(color.r, max(color.g, color.b)); - float h = 0.0; - float s = 0.0; - float l = (cmin + cmax) / 2.0; - float diff = cmax - cmin; - - if (diff > 1.0 / 256.0) { - if (l < 0.5) - s = diff / (cmin + cmax); - else - s = diff / (2.0 - (cmin + cmax)); - - if (color.r == cmax) - h = (color.g - color.b) / diff; - else if (color.g == cmax) - h = 2.0 + (color.b - color.r) / diff; - else - h = 4.0 + (color.r - color.g) / diff; - - h /= 6.0; - } - return vec3(h, s, l); -} - -float hueToIntensity(float v1, float v2, float h) -{ - h = fract(h); - if (h < 1.0 / 6.0) - return v1 + (v2 - v1) * 6.0 * h; - else if (h < 1.0 / 2.0) - return v2; - else if (h < 2.0 / 3.0) - return v1 + (v2 - v1) * 6.0 * (2.0 / 3.0 - h); - - return v1; -} - -vec3 HSLtoRGB(vec3 color) -{ - float h = color.x; - float l = color.z; - float s = color.y; - - if (s < 1.0 / 256.0) - return vec3(l); - - float v1; - float v2; - if (l < 0.5) - v2 = l * (1.0 + s); - else - v2 = (l + s) - (s * l); - - v1 = 2.0 * l - v2; - - float d = 1.0 / 3.0; - float r = hueToIntensity(v1, v2, h + d); - float g = hueToIntensity(v1, v2, h); - float b = hueToIntensity(v1, v2, h - d); - return vec3(r, g, b); -} - -void main() -{ - vec4 samp = texture(source, qt_TexCoord0); - samp = vec4(samp.rgb / max(1.0/256.0, samp.a), samp.a); - samp.rgb = mix(vec3(dot(samp.rgb, vec3(0.2125, 0.7154, 0.0721))), samp.rgb, 1.0 + hsl.y); - samp.xyz = RGBtoHSL(samp.rgb); - samp.rgb = HSLtoRGB(vec3(samp.x + hsl.x, samp.y, samp.z)); - float c = step(0.0, hsl.z); - samp.rgb = mix(samp.rgb, vec3(c), abs(hsl.z)); - fragColor = vec4(samp.rgb * samp.a, samp.a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/huesaturation.frag.qsb b/src/effects/shaders_ng/huesaturation.frag.qsb Binary files differdeleted file mode 100644 index 028a8b8..0000000 --- a/src/effects/shaders_ng/huesaturation.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/leveladjust.frag b/src/effects/shaders_ng/leveladjust.frag deleted file mode 100644 index d8cde59..0000000 --- a/src/effects/shaders_ng/leveladjust.frag +++ /dev/null @@ -1,47 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - vec3 minimumInputRGB; - vec3 maximumInputRGB; - float minimumInputAlpha; - float maximumInputAlpha; - vec3 minimumOutputRGB; - vec3 maximumOutputRGB; - float minimumOutputAlpha; - float maximumOutputAlpha; - vec3 gamma; -}; - -layout(binding = 1) uniform sampler2D source; - -float linearstep(float e0, float e1, float x) -{ - return clamp((x - e0) / (e1 - e0), 0.0, 1.0); -} - -void main() -{ - vec4 textureColor = texture(source, qt_TexCoord0.st); - vec4 color = vec4(textureColor.rgb / max(1.0/256.0, textureColor.a), textureColor.a); - - color.r = linearstep(minimumInputRGB.r, maximumInputRGB.r, color.r); - color.g = linearstep(minimumInputRGB.g, maximumInputRGB.g, color.g); - color.b = linearstep(minimumInputRGB.b, maximumInputRGB.b, color.b); - color.a = linearstep(minimumInputAlpha, maximumInputAlpha, color.a); - - color.rgb = pow(color.rgb, gamma); - - color.r = minimumOutputRGB.r + color.r * (maximumOutputRGB.r - minimumOutputRGB.r); - color.g = minimumOutputRGB.g + color.g * (maximumOutputRGB.g - minimumOutputRGB.g); - color.b = minimumOutputRGB.b + color.b * (maximumOutputRGB.b - minimumOutputRGB.b); - color.a = minimumOutputAlpha + color.a * (maximumOutputAlpha - minimumOutputAlpha); - - fragColor = vec4(color.rgb * color.a, color.a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/leveladjust.frag.qsb b/src/effects/shaders_ng/leveladjust.frag.qsb Binary files differdeleted file mode 100644 index fad450d..0000000 --- a/src/effects/shaders_ng/leveladjust.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/lineargradient.vert b/src/effects/shaders_ng/lineargradient.vert deleted file mode 100644 index cd8f8a8..0000000 --- a/src/effects/shaders_ng/lineargradient.vert +++ /dev/null @@ -1,31 +0,0 @@ -#version 440 - -layout(location = 0) in vec4 qt_Vertex; -layout(location = 1) in vec2 qt_MultiTexCoord0; - -layout(location = 0) out vec2 qt_TexCoord0; -layout(location = 1) out vec2 qt_TexCoord1; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; - vec2 startPoint; - vec2 matrixData; - float l; -}; - -out gl_PerVertex { vec4 gl_Position; }; - -void main() -{ - mat2 rot = mat2(matrixData.y, -matrixData.x, - matrixData.x, matrixData.y); - - qt_TexCoord0 = qt_MultiTexCoord0; - - qt_TexCoord1 = qt_MultiTexCoord0 * l; - qt_TexCoord1 -= startPoint * l; - qt_TexCoord1 *= rot; - - gl_Position = qt_Matrix * qt_Vertex; -} diff --git a/src/effects/shaders_ng/lineargradient.vert.qsb b/src/effects/shaders_ng/lineargradient.vert.qsb Binary files differdeleted file mode 100644 index 475ace8..0000000 --- a/src/effects/shaders_ng/lineargradient.vert.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/lineargradient_mask.frag b/src/effects/shaders_ng/lineargradient_mask.frag deleted file mode 100644 index dda85d7..0000000 --- a/src/effects/shaders_ng/lineargradient_mask.frag +++ /dev/null @@ -1,23 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 1) in vec2 qt_TexCoord1; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; - vec2 startPoint; - vec2 matrixData; - float l; -}; - -layout(binding = 1) uniform sampler2D source; -layout(binding = 2) uniform sampler2D maskSource; - -void main() -{ - vec4 gradientColor = texture(source, qt_TexCoord1); - float maskAlpha = texture(maskSource, qt_TexCoord0).a; - fragColor = gradientColor * maskAlpha * qt_Opacity; -} diff --git a/src/effects/shaders_ng/lineargradient_mask.frag.qsb b/src/effects/shaders_ng/lineargradient_mask.frag.qsb Binary files differdeleted file mode 100644 index 1e99b35..0000000 --- a/src/effects/shaders_ng/lineargradient_mask.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/lineargradient_nomask.frag b/src/effects/shaders_ng/lineargradient_nomask.frag deleted file mode 100644 index be1d992..0000000 --- a/src/effects/shaders_ng/lineargradient_nomask.frag +++ /dev/null @@ -1,20 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 1) in vec2 qt_TexCoord1; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; - vec2 startPoint; - vec2 matrixData; - float l; -}; - -layout(binding = 1) uniform sampler2D source; - -void main() -{ - fragColor = texture(source, qt_TexCoord1) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/lineargradient_nomask.frag.qsb b/src/effects/shaders_ng/lineargradient_nomask.frag.qsb Binary files differdeleted file mode 100644 index 99c479c..0000000 --- a/src/effects/shaders_ng/lineargradient_nomask.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/opacitymask.frag b/src/effects/shaders_ng/opacitymask.frag deleted file mode 100644 index 94a80b8..0000000 --- a/src/effects/shaders_ng/opacitymask.frag +++ /dev/null @@ -1,19 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; -}; - -layout(binding = 1) uniform sampler2D source; -layout(binding = 2) uniform sampler2D maskSource; - -void main() -{ - fragColor = texture(source, qt_TexCoord0.st) * (texture(maskSource, qt_TexCoord0.st).a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/opacitymask.frag.qsb b/src/effects/shaders_ng/opacitymask.frag.qsb Binary files differdeleted file mode 100644 index cef12b4..0000000 --- a/src/effects/shaders_ng/opacitymask.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/opacitymask_invert.frag b/src/effects/shaders_ng/opacitymask_invert.frag deleted file mode 100644 index 2506bdb..0000000 --- a/src/effects/shaders_ng/opacitymask_invert.frag +++ /dev/null @@ -1,19 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; -}; - -layout(binding = 1) uniform sampler2D source; -layout(binding = 2) uniform sampler2D maskSource; - -void main() -{ - fragColor = texture(source, qt_TexCoord0.st) * (1.0 - texture(maskSource, qt_TexCoord0.st).a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/opacitymask_invert.frag.qsb b/src/effects/shaders_ng/opacitymask_invert.frag.qsb Binary files differdeleted file mode 100644 index b622ff9..0000000 --- a/src/effects/shaders_ng/opacitymask_invert.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/radialgradient.vert b/src/effects/shaders_ng/radialgradient.vert deleted file mode 100644 index 27dd88a..0000000 --- a/src/effects/shaders_ng/radialgradient.vert +++ /dev/null @@ -1,39 +0,0 @@ -#version 440 - -layout(location = 0) in vec4 qt_Vertex; -layout(location = 1) in vec2 qt_MultiTexCoord0; - -layout(location = 0) out vec2 qt_TexCoord0; -layout(location = 1) out vec2 qt_TexCoord1; -layout(location = 2) out vec2 centerPoint; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; - vec2 center; - vec2 matrixData; - float horizontalRatio; - float verticalRatio; -}; - -out gl_PerVertex { vec4 gl_Position; }; - -void main() -{ - vec2 ratio = vec2(horizontalRatio, verticalRatio); - - mat2 rot = mat2(matrixData.y, -matrixData.x, - matrixData.x, matrixData.y); - - qt_TexCoord0 = qt_MultiTexCoord0; - - qt_TexCoord1 = qt_MultiTexCoord0; - qt_TexCoord1 -= center; - qt_TexCoord1 *= rot; - qt_TexCoord1 += center; - qt_TexCoord1 *= ratio; - - centerPoint = center * ratio; - - gl_Position = qt_Matrix * qt_Vertex; -} diff --git a/src/effects/shaders_ng/radialgradient.vert.qsb b/src/effects/shaders_ng/radialgradient.vert.qsb Binary files differdeleted file mode 100644 index 38961b8..0000000 --- a/src/effects/shaders_ng/radialgradient.vert.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/radialgradient_mask.frag b/src/effects/shaders_ng/radialgradient_mask.frag deleted file mode 100644 index b67d67f..0000000 --- a/src/effects/shaders_ng/radialgradient_mask.frag +++ /dev/null @@ -1,25 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 1) in vec2 qt_TexCoord1; -layout(location = 2) in vec2 centerPoint; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; - vec2 center; - vec2 matrixData; - float horizontalRatio; - float verticalRatio; -}; - -layout(binding = 1) uniform sampler2D gradientImage; -layout(binding = 2) uniform sampler2D maskSource; - -void main() -{ - vec4 gradientColor = texture(gradientImage, vec2(0.0, 2.0 * distance(qt_TexCoord1, centerPoint))); - float maskAlpha = texture(maskSource, qt_TexCoord0).a; - fragColor = gradientColor * maskAlpha * qt_Opacity; -} diff --git a/src/effects/shaders_ng/radialgradient_mask.frag.qsb b/src/effects/shaders_ng/radialgradient_mask.frag.qsb Binary files differdeleted file mode 100644 index 8606a67..0000000 --- a/src/effects/shaders_ng/radialgradient_mask.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/radialgradient_nomask.frag b/src/effects/shaders_ng/radialgradient_nomask.frag deleted file mode 100644 index 777d53d..0000000 --- a/src/effects/shaders_ng/radialgradient_nomask.frag +++ /dev/null @@ -1,23 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 1) in vec2 qt_TexCoord1; -layout(location = 2) in vec2 centerPoint; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - mat4 qt_Matrix; - float qt_Opacity; - vec2 center; - vec2 matrixData; - float horizontalRatio; - float verticalRatio; -}; - -layout(binding = 1) uniform sampler2D gradientImage; - -void main() -{ - vec4 gradientColor = texture(gradientImage, vec2(0.0, 2.0 * distance(qt_TexCoord1, centerPoint))); - fragColor = gradientColor * qt_Opacity; -} diff --git a/src/effects/shaders_ng/radialgradient_nomask.frag.qsb b/src/effects/shaders_ng/radialgradient_nomask.frag.qsb Binary files differdeleted file mode 100644 index 1df3ebc..0000000 --- a/src/effects/shaders_ng/radialgradient_nomask.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/rectangularglow.frag b/src/effects/shaders_ng/rectangularglow.frag deleted file mode 100644 index cf20b93..0000000 --- a/src/effects/shaders_ng/rectangularglow.frag +++ /dev/null @@ -1,30 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - vec4 color; - float relativeSizeX; - float relativeSizeY; - float spread; -}; - -float linearstep(float e0, float e1, float x) -{ - return clamp((x - e0) / (e1 - e0), 0.0, 1.0); -} - -void main() -{ - float alpha = - smoothstep(0.0, relativeSizeX, 0.5 - abs(0.5 - qt_TexCoord0.x)) * - smoothstep(0.0, relativeSizeY, 0.5 - abs(0.5 - qt_TexCoord0.y)); - - float spreadMultiplier = linearstep(spread, 1.0 - spread, alpha); - fragColor = color * qt_Opacity * spreadMultiplier * spreadMultiplier; -} diff --git a/src/effects/shaders_ng/rectangularglow.frag.qsb b/src/effects/shaders_ng/rectangularglow.frag.qsb Binary files differdeleted file mode 100644 index 7eaf930..0000000 --- a/src/effects/shaders_ng/rectangularglow.frag.qsb +++ /dev/null diff --git a/src/effects/shaders_ng/thresholdmask.frag b/src/effects/shaders_ng/thresholdmask.frag deleted file mode 100644 index 7740e7e..0000000 --- a/src/effects/shaders_ng/thresholdmask.frag +++ /dev/null @@ -1,23 +0,0 @@ -#version 440 - -layout(location = 0) in vec2 qt_TexCoord0; -layout(location = 0) out vec4 fragColor; - -layout(std140, binding = 0) uniform buf { - // qt_Matrix and qt_Opacity must always be both present - // if the built-in vertex shader is used. - mat4 qt_Matrix; - float qt_Opacity; - float threshold; - float spread; -}; - -layout(binding = 1) uniform sampler2D source; -layout(binding = 2) uniform sampler2D maskSource; - -void main() -{ - vec4 colorFragment = texture(source, qt_TexCoord0.st); - vec4 maskFragment = texture(maskSource, qt_TexCoord0.st); - fragColor = colorFragment * smoothstep(threshold * (1.0 + spread) - spread, threshold * (1.0 + spread), maskFragment.a) * qt_Opacity; -} diff --git a/src/effects/shaders_ng/thresholdmask.frag.qsb b/src/effects/shaders_ng/thresholdmask.frag.qsb Binary files differdeleted file mode 100644 index 38e7391..0000000 --- a/src/effects/shaders_ng/thresholdmask.frag.qsb +++ /dev/null |