Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Commit

Permalink
don't clip glyphs with the frustum
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaefer committed Aug 21, 2015
1 parent 8d5df59 commit c4093b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdf.vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void main() {
float a_maxzoom = a_zoom[1];

// u_zoom is the current zoom level adjusted for the change in font size
float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));
float show = step(a_minzoom, u_zoom) * (1.0 - step(a_maxzoom, u_zoom));

// fade out labels
float alpha = clamp((u_fadezoom - a_labelminzoom) / u_fadedist, 0.0, 1.0);
Expand All @@ -46,8 +46,8 @@ void main() {
}

// if label has been faded out, clip it
z += step(v_alpha, 0.0);
show *= (1.0 - step(v_alpha, 0.0));

gl_Position = u_matrix * vec4(a_pos, 0, 1) + u_exmatrix * vec4(a_offset / 64.0, z, 0);
gl_Position = u_matrix * vec4(a_pos, 0, 1) + u_exmatrix * vec4(a_offset * show / 64.0, 0, 0);
v_tex = a_tex / u_texsize;
}

0 comments on commit c4093b5

Please sign in to comment.