summaryrefslogtreecommitdiff
path: root/src/mbgl/shaders/symbol_sdf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/shaders/symbol_sdf.cpp')
-rw-r--r--src/mbgl/shaders/symbol_sdf.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mbgl/shaders/symbol_sdf.cpp b/src/mbgl/shaders/symbol_sdf.cpp
index 441eaf7aac..46bab10be5 100644
--- a/src/mbgl/shaders/symbol_sdf.cpp
+++ b/src/mbgl/shaders/symbol_sdf.cpp
@@ -156,7 +156,10 @@ void main() {
highp float distance_ratio = u_pitch_with_map ?
camera_to_anchor_distance / u_camera_to_center_distance :
u_camera_to_center_distance / camera_to_anchor_distance;
- highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;
+ highp float perspective_ratio = clamp(
+ 0.5 + 0.5 * distance_ratio,
+ 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles
+ 4.0);
size *= perspective_ratio;