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

prevent overdraw by not retaining parent tiles for sparse tilesets #7051

Closed

Conversation

mollymerp
Copy link
Contributor

@mollymerp mollymerp commented Jul 30, 2018

This is one possible interim solution for #6768. A long term fix will likely involve changes on the server side that distinguish between not found and no content responses.

I'm posting this early without tests to gather feedback on whether we want to move forward with this approach. I used #6995 as the base branch to avoid future conflicts.

The change boils down to:

  • if an ideal tile is unavailable (hasn't loaded yet or has errored) and if the underlying source is not raster
    • start ascending the tile pyramid to find a valid parent tile,
    • if the parent tile has both a successfully loaded child, and an errored child tile
      • infer that the tileset is sparse and set sourceCache.sparse = true
      • do not retain the parent tile to prevent overdraw on the loaded child tile
      • and for future tile pyramid ascents for other unavailable tiles, only ascend one zoom level above the ideal zoom to prevent overdraw from grandparent tiles or other ancestors

Pros:

  • low-lift approach
  • removes overdraw on most rendered frames

Cons:

  • overdraw can still flicker on zoom-level changes (similar to what happens in native right now)
  • fast zooming will purge loaded parent tiles before children have loaded causing a flicker on sparse tilesets
  • not yet fully tested, will change existing behavior for some users of sparse tilesets

My main question is whether folks think this is an OK interim solution and is worth polishing and testing more thoroughly for the next release

cc @ryanhamley @jfirebaugh @ryanbaumann @lilykaiser

overdraw

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • tagged @mapbox/studio and/or @mapbox/maps-design if this PR includes style spec changes

@mollymerp
Copy link
Contributor Author

another note: this almost completely fixes the issue for heatmaps seen in #6560 (afaict)
before this PR
before

after this PR
aftersmall

cc @ksummerill

@mollymerp mollymerp mentioned this pull request Aug 1, 2018
2 tasks
@mollymerp
Copy link
Contributor Author

closing this in favor of #6803 in the interest of keeping gl-js and gl-native consistent. #6803 still fixes #6560 and eliminates persistent overdrawing on sparse tilesets.

@mollymerp mollymerp closed this Aug 1, 2018
@asheemmamoowala asheemmamoowala deleted the overdraw-fix-inferred-sparse branch March 9, 2021 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant