mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Fix 1-pixel flickering between tiles on dark styles

Open mpulkki-mapbox opened this issue 2 years ago • 0 comments

This pull request fixes the flickering issue between tiles (https://github.com/mapbox/mapbox-gl-js/issues/11858) by extruding vertices of globe tiles slightly towards the neighbouring tiles. Based on empirical testing I found 0.5 pixels to be enough to stitch seams on all of my test devices using different pixel ratios. It should be noted that the texture sampling is unaffected even though tiles are scaled up by a tiny amount. Any possible extra fragments will have their uvs clamped to range [0, 1].

Fixes https://github.com/mapbox/mapbox-gl-js/issues/11858

Launch Checklist

  • [x] briefly describe the changes in this PR
  • [ ] include before/after visuals or gifs if this PR includes visual changes
  • [x] write tests for all new functionality
  • [ ] document any changes to public APIs
  • [ ] post benchmark scores
  • [x] manually test the debug page
  • [ ] tagged @mapbox/map-design-team @mapbox/static-apis if this PR includes style spec API or visual changes
  • [ ] tagged @mapbox/gl-native if this PR includes shader changes or needs a native port
  • [x] apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • [x] add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fix pixel flickering between tiles on darker styles in globe view.</changelog>

mpulkki-mapbox avatar Aug 09 '22 08:08 mpulkki-mapbox