aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/imagine/impl/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/imagine/impl/shaders')
-rw-r--r--src/imports/controls/imagine/impl/shaders/+glslcore/OpacityMask.frag13
-rw-r--r--src/imports/controls/imagine/impl/shaders/+qsb/OpacityMask.fragbin0 -> 1409 bytes
-rw-r--r--src/imports/controls/imagine/impl/shaders/OpacityMask.frag7
-rw-r--r--src/imports/controls/imagine/impl/shaders/OpacityMask_rhi.frag17
-rw-r--r--src/imports/controls/imagine/impl/shaders/compile.bat40
5 files changed, 77 insertions, 0 deletions
diff --git a/src/imports/controls/imagine/impl/shaders/+glslcore/OpacityMask.frag b/src/imports/controls/imagine/impl/shaders/+glslcore/OpacityMask.frag
new file mode 100644
index 00000000..529e2696
--- /dev/null
+++ b/src/imports/controls/imagine/impl/shaders/+glslcore/OpacityMask.frag
@@ -0,0 +1,13 @@
+#version 150
+
+uniform float qt_Opacity;
+uniform sampler2D source;
+uniform sampler2D maskSource;
+
+in vec2 qt_TexCoord0;
+out vec4 fragColor;
+
+void main()
+{
+ fragColor = texture(source, qt_TexCoord0.st) * (texture(maskSource, qt_TexCoord0.st).a) * qt_Opacity;
+}
diff --git a/src/imports/controls/imagine/impl/shaders/+qsb/OpacityMask.frag b/src/imports/controls/imagine/impl/shaders/+qsb/OpacityMask.frag
new file mode 100644
index 00000000..331b30b8
--- /dev/null
+++ b/src/imports/controls/imagine/impl/shaders/+qsb/OpacityMask.frag
Binary files differ
diff --git a/src/imports/controls/imagine/impl/shaders/OpacityMask.frag b/src/imports/controls/imagine/impl/shaders/OpacityMask.frag
new file mode 100644
index 00000000..84f9bc3e
--- /dev/null
+++ b/src/imports/controls/imagine/impl/shaders/OpacityMask.frag
@@ -0,0 +1,7 @@
+varying highp vec2 qt_TexCoord0;
+uniform highp float qt_Opacity;
+uniform lowp sampler2D source;
+uniform lowp sampler2D maskSource;
+void main(void) {
+ gl_FragColor = texture2D(source, qt_TexCoord0.st) * (texture2D(maskSource, qt_TexCoord0.st).a) * qt_Opacity;
+}
diff --git a/src/imports/controls/imagine/impl/shaders/OpacityMask_rhi.frag b/src/imports/controls/imagine/impl/shaders/OpacityMask_rhi.frag
new file mode 100644
index 00000000..9ae32499
--- /dev/null
+++ b/src/imports/controls/imagine/impl/shaders/OpacityMask_rhi.frag
@@ -0,0 +1,17 @@
+#version 440
+
+layout(location = 0) in vec2 qt_TexCoord0;
+layout(location = 0) out vec4 fragColor;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 qt_Matrix;
+ float qt_Opacity;
+} ubuf;
+
+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) * ubuf.qt_Opacity;
+}
diff --git a/src/imports/controls/imagine/impl/shaders/compile.bat b/src/imports/controls/imagine/impl/shaders/compile.bat
new file mode 100644
index 00000000..8f16d7ac
--- /dev/null
+++ b/src/imports/controls/imagine/impl/shaders/compile.bat
@@ -0,0 +1,40 @@
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+::
+:: Copyright (C) 2020 The Qt Company Ltd.
+:: Contact: https://www.qt.io/licensing/
+::
+:: This file is part of the QtQuick module of the Qt Toolkit.
+::
+:: $QT_BEGIN_LICENSE:LGPL$
+:: 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.
+::
+:: GNU Lesser General Public License Usage
+:: Alternatively, this file may be used under the terms of the GNU Lesser
+:: General Public License version 3 as published by the Free Software
+:: Foundation and appearing in the file LICENSE.LGPL3 included in the
+:: packaging of this file. Please review the following information to
+:: ensure the GNU Lesser General Public License version 3 requirements
+:: will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+::
+:: GNU General Public License Usage
+:: Alternatively, this file may be used under the terms of the GNU
+:: General Public License version 2.0 or (at your option) the GNU General
+:: Public license version 3 or any later version approved by the KDE Free
+:: Qt Foundation. The licenses are as published by the Free Software
+:: Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+:: included in the packaging of this file. Please review the following
+:: information to ensure the GNU General Public License requirements will
+:: be met: https://www.gnu.org/licenses/gpl-2.0.html and
+:: https://www.gnu.org/licenses/gpl-3.0.html.
+::
+:: $QT_END_LICENSE$
+::
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/OpacityMask.frag OpacityMask_rhi.frag