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 missing tiles at bottom of screen during globe-Mercator transition #11988

Merged
merged 11 commits into from
Jul 1, 2022

Conversation

SnailBones
Copy link
Contributor

@SnailBones SnailBones commented Jun 10, 2022

Closes https://github.com/mapbox/gl-js-team/issues/443

All changes to functionality are in 34762b0, previous commits are refactoring from #11987

Ported from https://github.com/mapbox/mapbox-gl-native-internal/pull/3450

Fix 1

  • Description: Rendering artefacts (missing tiles) when the zoom level is just below the threshold for mercator projection. Most prominent with high pitch views where tiles at the bottom of the screen might disappear.
  • Cause: Visible tiles on the screen are found by comparing whether the camera frustum is intersecting with axis aligned bounding boxes (aabb) of tiles. Prior to this PR aabbs of tiles were not interpolated during the transition between globe and mercator: either mercator aabbs or globe aabb were used, nothing in between. This is why these issues were appearing on zoom levels just below 6.
  • Fix: Compute aabbs from interpolated tile vertices.

The issue in GL JS, in this case with a pole circle visible:
image

Test before fix on left, after fix on right:
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
  • port wrapping
  • 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>Fix occasional missing tiles at bottom of screen during globe-Mercator transition</changelog>

@SnailBones SnailBones marked this pull request as ready for review June 16, 2022 17:31
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.

LGTM after addressing review comments from #11987 and a rebase.

src/geo/projection/globe_util.js Outdated Show resolved Hide resolved
Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
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.

👍

@karimnaaji karimnaaji merged commit ef73895 into main Jul 1, 2022
@karimnaaji karimnaaji deleted the aidan/globe-tile-cover branch July 1, 2022 17:50
SnailBones added a commit that referenced this pull request Aug 2, 2022
karimnaaji pushed a commit that referenced this pull request Aug 2, 2022
* Use max instead of interpolating arc midopint

* Adding render test

* Correcting cornerMin + cornerMax, undoing change to arc extremum interpolation

* Removing interpolation introduced in #11988

* Fix CI

* Updating baseline reflecting less tiles loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants