Skip to content

Reduce blurriness of draped line rendering #11531

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

Merged
merged 2 commits into from
Feb 22, 2022

Conversation

mpulkki-mapbox
Copy link
Contributor

@mpulkki-mapbox mpulkki-mapbox commented Feb 18, 2022

Prior to this change lines were appearing too blurry in draped rendering (terrain and globe) because wrong pixel ratio was used on high DPI devices. The ratio should always be 1 when rendering to an offscreen texture. Too large pixel ratio will mess up the anti-aliasing logic resulting in this pixelated/blurred effect. Ported from gl-native, original author @endanke.

Before and after images from an iphone XS:

image

image

TODO

  • Add render tests to validate the change

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
  • 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>Reduce blurriness of line layers when used with the terrain on high DPI devices.</changelog>

Sorry, something went wrong.

@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-fix-draped-line-rendering branch from b6cb1cf to fc085f1 Compare February 21, 2022 08:49
@mpulkki-mapbox mpulkki-mapbox marked this pull request as ready for review February 21, 2022 08:49
Copy link
Contributor

@karimnaaji karimnaaji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@karimnaaji karimnaaji merged commit cd5e962 into main Feb 22, 2022
@karimnaaji karimnaaji deleted the mpulkki-fix-draped-line-rendering branch February 22, 2022 23:42
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.

None yet

2 participants