Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blurry map-aligned labels on terrain #10296

Merged
merged 2 commits into from
Jan 15, 2021
Merged

Conversation

mourner
Copy link
Member

@mourner mourner commented Jan 15, 2021

Closes #10220. Before we added terrain, we had a heuristic for map-aligned labels to get blurrier as you pitch the map to compensate for aliasing when labels get squished. However, this approach breaks on terrain-enabled maps because we can't adjust all labels equally — some of them will be on hilly areas and not as squished, as apparent in the issue.

This is an easy fix that simply disables map-alignment label blurring when on terrain. Ideally, in future we could reintroduce this blurring properly by moving from a global gamma adjustment to one calculated in the vertex shader depending on the slope, but that's too involved for the small benefit at the moment — labels look pretty good on terrain with this fix too.

Before:
image

After:
image

Launch Checklist

  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • manually test the debug page
  • tagged @astojilj because this affects native port
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fix blurry map-aligned labels on highly pitched maps with terrain</changelog>

@mourner mourner requested a review from ansis January 15, 2021 17:40
@mourner mourner self-assigned this Jan 15, 2021
@mourner mourner merged commit 07179fe into main Jan 15, 2021
@mourner mourner deleted the fix-blurry-terrain-labels branch January 15, 2021 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blurry line labels on v2 3D map
3 participants