summaryrefslogtreecommitdiff
path: root/data/shaders/path-fill-vert.glsl
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-09-07 20:12:35 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-09-08 07:24:43 -0400
commitb63ce7f900ee6a4631eacd1db07b2c9c9be12780 (patch)
tree853f02e690a84de7de46382cf68f0788a84d2691 /data/shaders/path-fill-vert.glsl
parentde3be995ed26f9ea78f7462095919ba08df2cd25 (diff)
graphics: path: Add support for linear/radial gradient fills.
Diffstat (limited to 'data/shaders/path-fill-vert.glsl')
-rw-r--r--data/shaders/path-fill-vert.glsl9
1 files changed, 8 insertions, 1 deletions
diff --git a/data/shaders/path-fill-vert.glsl b/data/shaders/path-fill-vert.glsl
index d95b71b..1752978 100644
--- a/data/shaders/path-fill-vert.glsl
+++ b/data/shaders/path-fill-vert.glsl
@@ -8,6 +8,12 @@ in vec2 position;
attribute vec2 position;
#endif
+#ifdef GLSL120
+varying vec2 fragPosition;
+#else
+out vec2 fragPosition;
+#endif
+
uniform mat4 mvp;
uniform vec4 color;
@@ -17,6 +23,7 @@ void main(void) {
if (color.a <= 0.0) {
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
} else {
- gl_Position = mvp * vec4(position.xy, 0.0, 1.0);
+ fragPosition = position;
+ gl_Position = mvp * vec4(position, 0.0, 1.0);
}
}