diff options
author | David Thompson <dthompson2@worcester.edu> | 2021-08-27 16:07:38 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2021-08-27 16:09:23 -0400 |
commit | 9b5d364add330fc18100491bf3c57316a27183f5 (patch) | |
tree | 7799b4b8ae3224a4bdd6e4ec82db796a12b4d5c7 /data/shaders/path-fill-vert.glsl | |
parent | 9b6c5e3ba42eace457ce96600fecd31109e976ab (diff) |
graphics: path: Separate fill/stroke into different shaders.
Diffstat (limited to 'data/shaders/path-fill-vert.glsl')
-rw-r--r-- | data/shaders/path-fill-vert.glsl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/data/shaders/path-fill-vert.glsl b/data/shaders/path-fill-vert.glsl new file mode 100644 index 0000000..d95b71b --- /dev/null +++ b/data/shaders/path-fill-vert.glsl @@ -0,0 +1,22 @@ +// -*- mode: c -*- + +#ifdef GLSL330 +layout (location = 0) in vec2 position; +#elif defined(GLSL130) +in vec2 position; +#elif defined(GLSL120) +attribute vec2 position; +#endif + +uniform mat4 mvp; +uniform vec4 color; + +void main(void) { + // Short-circuit because the fragments will just be discarded + // anyway. + 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); + } +} |