Fix blurry map-aligned labels on terrain #10296
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
After:
Launch Checklist
mapbox-gl-js
changelog:<changelog>Fix blurry map-aligned labels on highly pitched maps with terrain</changelog>