Skip to content

Commit

Permalink
fix dashed and pattern line rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Mar 4, 2015
1 parent 9d3efcd commit 98d1407
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions shaders/line.vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,5 @@ void main() {
// how much features are squished in all directions by the perspectiveness
float perspective_scale = 1.0 / (1.0 - y * u_extra);

// the 1.1 adds a tiny bit of extra blurriness to account for the inexactness of these calculations
gamma_scale = perspective_scale * squish_scale * 1.1;
gamma_scale = perspective_scale * squish_scale;
}
2 changes: 1 addition & 1 deletion shaders/linepattern.vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void main() {
// 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 / 2.0), 0.0, 1.0) + u_exmatrix * vec4(dist, 0.0, 0.0);
gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + dist.xy / u_ratio, 0.0, 1.0);
v_linesofar = a_linesofar;// * u_ratio;

}
2 changes: 1 addition & 1 deletion shaders/linesdfpattern.vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void main() {
// 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), 0.0, 1.0) + u_exmatrix * dist;
gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + dist.xy / u_ratio, 0.0, 1.0);

v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);
v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);
Expand Down

0 comments on commit 98d1407

Please sign in to comment.