aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/shapes/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/shapes/shaders')
-rw-r--r--src/imports/shapes/shaders/blit.frag9
-rw-r--r--src/imports/shapes/shaders/blit.vert12
-rw-r--r--src/imports/shapes/shaders/blit_core.frag13
-rw-r--r--src/imports/shapes/shaders/blit_core.vert14
-rw-r--r--src/imports/shapes/shaders/lineargradient.frag9
-rw-r--r--src/imports/shapes/shaders/lineargradient.vert15
-rw-r--r--src/imports/shapes/shaders/lineargradient_core.frag12
-rw-r--r--src/imports/shapes/shaders/lineargradient_core.vert17
8 files changed, 101 insertions, 0 deletions
diff --git a/src/imports/shapes/shaders/blit.frag b/src/imports/shapes/shaders/blit.frag
new file mode 100644
index 0000000000..505f0db179
--- /dev/null
+++ b/src/imports/shapes/shaders/blit.frag
@@ -0,0 +1,9 @@
+varying highp vec2 qt_TexCoord0;
+
+uniform sampler2D source;
+uniform lowp float qt_Opacity;
+
+void main()
+{
+ gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity;
+}
diff --git a/src/imports/shapes/shaders/blit.vert b/src/imports/shapes/shaders/blit.vert
new file mode 100644
index 0000000000..f8306bd945
--- /dev/null
+++ b/src/imports/shapes/shaders/blit.vert
@@ -0,0 +1,12 @@
+uniform highp mat4 qt_Matrix;
+
+attribute highp vec4 qt_Vertex;
+attribute highp vec2 qt_MultiTexCoord0;
+
+varying highp vec2 qt_TexCoord0;
+
+void main()
+{
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_Matrix * qt_Vertex;
+}
diff --git a/src/imports/shapes/shaders/blit_core.frag b/src/imports/shapes/shaders/blit_core.frag
new file mode 100644
index 0000000000..7073808fba
--- /dev/null
+++ b/src/imports/shapes/shaders/blit_core.frag
@@ -0,0 +1,13 @@
+#version 150 core
+
+in vec2 qt_TexCoord0;
+
+out vec4 fragColor;
+
+uniform sampler2D source;
+uniform float qt_Opacity;
+
+void main()
+{
+ fragColor = texture(source, qt_TexCoord0) * qt_Opacity;
+}
diff --git a/src/imports/shapes/shaders/blit_core.vert b/src/imports/shapes/shaders/blit_core.vert
new file mode 100644
index 0000000000..5246441da3
--- /dev/null
+++ b/src/imports/shapes/shaders/blit_core.vert
@@ -0,0 +1,14 @@
+#version 150 core
+
+in vec4 qt_Vertex;
+in vec2 qt_MultiTexCoord0;
+
+out vec2 qt_TexCoord0;
+
+uniform mat4 qt_Matrix;
+
+void main()
+{
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ gl_Position = qt_Matrix * qt_Vertex;
+}
diff --git a/src/imports/shapes/shaders/lineargradient.frag b/src/imports/shapes/shaders/lineargradient.frag
new file mode 100644
index 0000000000..7f4a739109
--- /dev/null
+++ b/src/imports/shapes/shaders/lineargradient.frag
@@ -0,0 +1,9 @@
+uniform sampler2D gradTabTexture;
+uniform highp float opacity;
+
+varying highp float gradTabIndex;
+
+void main()
+{
+ gl_FragColor = texture2D(gradTabTexture, vec2(gradTabIndex, 0.5)) * opacity;
+}
diff --git a/src/imports/shapes/shaders/lineargradient.vert b/src/imports/shapes/shaders/lineargradient.vert
new file mode 100644
index 0000000000..eb21b8886b
--- /dev/null
+++ b/src/imports/shapes/shaders/lineargradient.vert
@@ -0,0 +1,15 @@
+attribute vec4 vertexCoord;
+attribute vec4 vertexColor;
+
+uniform mat4 matrix;
+uniform vec2 gradStart;
+uniform vec2 gradEnd;
+
+varying float gradTabIndex;
+
+void main()
+{
+ vec2 gradVec = gradEnd - gradStart;
+ gradTabIndex = dot(gradVec, vertexCoord.xy - gradStart) / (gradVec.x * gradVec.x + gradVec.y * gradVec.y);
+ gl_Position = matrix * vertexCoord;
+}
diff --git a/src/imports/shapes/shaders/lineargradient_core.frag b/src/imports/shapes/shaders/lineargradient_core.frag
new file mode 100644
index 0000000000..5908acfa67
--- /dev/null
+++ b/src/imports/shapes/shaders/lineargradient_core.frag
@@ -0,0 +1,12 @@
+#version 150 core
+
+uniform sampler2D gradTabTexture;
+uniform float opacity;
+
+in float gradTabIndex;
+out vec4 fragColor;
+
+void main()
+{
+ fragColor = texture(gradTabTexture, vec2(gradTabIndex, 0.5)) * opacity;
+}
diff --git a/src/imports/shapes/shaders/lineargradient_core.vert b/src/imports/shapes/shaders/lineargradient_core.vert
new file mode 100644
index 0000000000..60b56f38e3
--- /dev/null
+++ b/src/imports/shapes/shaders/lineargradient_core.vert
@@ -0,0 +1,17 @@
+#version 150 core
+
+in vec4 vertexCoord;
+in vec4 vertexColor;
+
+uniform mat4 matrix;
+uniform vec2 gradStart;
+uniform vec2 gradEnd;
+
+out float gradTabIndex;
+
+void main()
+{
+ vec2 gradVec = gradEnd - gradStart;
+ gradTabIndex = dot(gradVec, vertexCoord.xy - gradStart) / (gradVec.x * gradVec.x + gradVec.y * gradVec.y);
+ gl_Position = matrix * vertexCoord;
+}