aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickshapes/shaders_ng/lineargradient.frag
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickshapes/shaders_ng/lineargradient.frag')
-rw-r--r--src/quickshapes/shaders_ng/lineargradient.frag18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/quickshapes/shaders_ng/lineargradient.frag b/src/quickshapes/shaders_ng/lineargradient.frag
new file mode 100644
index 0000000000..16894fc764
--- /dev/null
+++ b/src/quickshapes/shaders_ng/lineargradient.frag
@@ -0,0 +1,18 @@
+#version 440
+
+layout(location = 0) in float gradTabIndex;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2D gradTabTexture;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 matrix;
+ vec2 gradStart;
+ vec2 gradEnd;
+ float opacity;
+} ubuf;
+
+void main()
+{
+ fragColor = texture(gradTabTexture, vec2(gradTabIndex, 0.5)) * ubuf.opacity;
+}