diff options
author | Molly Lloyd <molly@mapbox.com> | 2016-04-20 15:21:44 -0700 |
---|---|---|
committer | Molly Lloyd <molly@mapbox.com> | 2016-04-28 17:13:20 -0700 |
commit | c86f558e9d608ac19ca5b26ea8f72e2dc43c07c0 (patch) | |
tree | c398f14a1cdc646119fac4ac8c0d557ca970e29d /src/mbgl/shader/outlinepattern.vertex.glsl | |
parent | da78422c5c37b2150eefeb399658903e45bf05d9 (diff) | |
download | qtlocation-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.glsl | 21 |
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; +} |