summaryrefslogtreecommitdiff
path: root/src/mbgl/shader/line.vertex.glsl
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2015-08-27 17:33:56 -0400
committerAnsis Brammanis <brammanis@gmail.com>2015-08-27 17:42:27 -0400
commitd50ade7aa47a4460b0d6bc4e89f83288070b8d9f (patch)
tree4b93cb3e1091e7f45c5016d372672726e5d6576e /src/mbgl/shader/line.vertex.glsl
parent294b307cb3f470b1cf5fb94633c9082dc0bfd719 (diff)
downloadqtlocation-mapboxgl-d50ade7aa47a4460b0d6bc4e89f83288070b8d9f.tar.gz
improve dashed and patterned line antialiasing
in perspective view. This is exactly the same approach used for regular lines. I just forgot to implement it for these types of lines.
Diffstat (limited to 'src/mbgl/shader/line.vertex.glsl')
-rw-r--r--src/mbgl/shader/line.vertex.glsl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/shader/line.vertex.glsl b/src/mbgl/shader/line.vertex.glsl
index 3b3caaab15..980212384b 100644
--- a/src/mbgl/shader/line.vertex.glsl
+++ b/src/mbgl/shader/line.vertex.glsl
@@ -34,13 +34,13 @@ void main() {
// Scale the extrusion vector down to a normal and then up by the line width
// of this vertex.
- vec4 dist = vec4(u_linewidth.s * a_extrude * scale, 0.0, 0.0);
+ vec2 dist = u_linewidth.s * a_extrude * scale;
// Remove the texture normal bit of the position before scaling it with the
// model/view matrix. Add the extrusion vector *after* the model/view matrix
// because we're extruding the line in pixel space, regardless of the current
// tile's zoom level.
- gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + dist.xy / u_ratio, 0.0, 1.0);
+ gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + dist / u_ratio, 0.0, 1.0);
// position of y on the screen
float y = gl_Position.y / gl_Position.w;