aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/shapes/shaders/lineargradient_core.vert
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/shapes/shaders/lineargradient_core.vert')
-rw-r--r--src/imports/shapes/shaders/lineargradient_core.vert17
1 files changed, 17 insertions, 0 deletions
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;
+}