summaryrefslogtreecommitdiff
path: root/src/mbgl/shader/outlinepattern.vertex.glsl
diff options
context:
space:
mode:
authorMolly Lloyd <molly@mapbox.com>2016-04-20 15:21:44 -0700
committerMolly Lloyd <molly@mapbox.com>2016-04-28 17:13:20 -0700
commitc86f558e9d608ac19ca5b26ea8f72e2dc43c07c0 (patch)
treec398f14a1cdc646119fac4ac8c0d557ca970e29d /src/mbgl/shader/outlinepattern.vertex.glsl
parentda78422c5c37b2150eefeb399658903e45bf05d9 (diff)
downloadqtlocation-mapboxgl-c86f558e9d608ac19ca5b26ea8f72e2dc43c07c0.tar.gz
[core] port outlinepattern for fill-pattern anti-aliasing from gl-js to native
add outlinepattern shader class to relevant files add outlinepattern code to painter_fill.cpp add outlinepattern code to fill_bucket refactor painter_fill, fix tests fix merge conflicts and setDepthSublayer update render test to no antialiasing so travis will be happy
Diffstat (limited to 'src/mbgl/shader/outlinepattern.vertex.glsl')
-rw-r--r--src/mbgl/shader/outlinepattern.vertex.glsl21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mbgl/shader/outlinepattern.vertex.glsl b/src/mbgl/shader/outlinepattern.vertex.glsl
new file mode 100644
index 0000000000..e31b77b560
--- /dev/null
+++ b/src/mbgl/shader/outlinepattern.vertex.glsl
@@ -0,0 +1,21 @@
+uniform vec2 u_patternscale_a;
+uniform vec2 u_patternscale_b;
+uniform vec2 u_offset_a;
+uniform vec2 u_offset_b;
+
+attribute vec2 a_pos;
+
+uniform mat4 u_matrix;
+uniform vec2 u_world;
+
+varying vec2 v_pos_a;
+varying vec2 v_pos_b;
+varying vec2 v_pos;
+
+
+void main() {
+ gl_Position = u_matrix * vec4(a_pos, 0, 1);
+ v_pos_a = u_patternscale_a * a_pos + u_offset_a;
+ v_pos_b = u_patternscale_b * a_pos + u_offset_b;
+ v_pos = (gl_Position.xy/gl_Position.w + 1.0) / 2.0 * u_world;
+}