summaryrefslogtreecommitdiff
path: root/data/shaders/path-stroke-frag.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'data/shaders/path-stroke-frag.glsl')
-rw-r--r--data/shaders/path-stroke-frag.glsl18
1 files changed, 16 insertions, 2 deletions
diff --git a/data/shaders/path-stroke-frag.glsl b/data/shaders/path-stroke-frag.glsl
index 9682c8f..324e3cf 100644
--- a/data/shaders/path-stroke-frag.glsl
+++ b/data/shaders/path-stroke-frag.glsl
@@ -14,6 +14,7 @@ in vec2 fragTex;
in float fragStrokeLength;
#endif
+#ifdef GLSL120
uniform vec4 color;
uniform float feather;
uniform int strokeClosed;
@@ -21,6 +22,19 @@ uniform float strokeWidth;
uniform int strokeCap;
uniform int strokeMiterStyle;
uniform float strokeMiterLimit;
+#else
+layout (std140) uniform Stroke
+{
+ mat4 mvp;
+ vec4 color;
+ float feather;
+ float strokeWidth;
+ float strokeMiterLimit;
+ int strokeClosed;
+ int strokeCap;
+ int strokeMiterStyle;
+};
+#endif
float infinity = 1.0 / 0.0;
@@ -47,7 +61,7 @@ void main(void) {
if (strokeCap == 0) { // none
d = infinity;
- } else if (strokeCap == 1) { // butt
+ } else if (strokeCap == 1) { // butt (huh huh)
d = max(dx + hw - 2 * feather, dy);
} else if (strokeCap == 2) { // square
d = max(dx, dy);
@@ -58,7 +72,7 @@ void main(void) {
} else if (strokeCap == 5) { // triangle in
d = max(dy, hw - feather + dx - dy);
}
- // Stroke inner/join
+ // Stroke inner/join
} else {
d = abs(v);
}