-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Render tile masks in order #1989
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1989 +/- ##
=======================================
Coverage 85.68% 85.69%
=======================================
Files 569 569
Lines 28049 28052 +3
=======================================
+ Hits 24035 24040 +5
+ Misses 4014 4012 -2 ☔ View full report in Codecov by Sentry. |
Bloaty Results 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-1989-compared-to-main.txtCompared to d387090 (legacy)
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-1989-compared-to-legacy.txt |
Bloaty Results (iOS) 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-1989-compared-to-main.txt |
I recognize the triangle from the Slack discussion, but I didn't see the issue number. Probably it's related, but a separate issue from the "Pastel" style linked there. Is a custom vector source tile-clipped? It doesn't seem like it should participate in the stencil masking at all. |
This seems to improve things, and makes sense to me. But looking way back, tiles have always been rendered to the stencil buffer in So I'm a little worried that I'm totally missing something here. Perhaps the order in which sources are listed matters, and it only worked before if they were in order of increasing max-zoom? |
Might be a good idea to try a bunch of the styles visually and see if there are problems. |
One observation I made - clipping masks were rendered during the opaque pass but the raster layer in the pastel style is translucent. That feels like it shouldn't work, since high zoom vector source tiles are possibly being rendered both in front and behind the raster layer. But everything is in the translucent pass. It feels like the most correct solution then would be to detect when visiting a new RenderItem with a different source and re-rendering the clipping mask for that source. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On zoom level >= 14 the behavior is a bit different still (see comment), but this fixes the problem with MapTiler Outdoors.
Let's focus on extending the render tests instead of manual checking.
I had been thinking along similar lines. Re-considering what are the correct criteria for rebuilding the mask reminded me that the way we decide that has changed, and that may have been a mistake. Specifically, a layer reuses the mask if the tiles are a subset of what's there, rather than set equality. If the tiles don't overlap that makes sense, but if there can be overlaps then sometimes a subset should be considered not equivalent. That was done because we were rebuilding the mask several times per frame in some cases, when some layers didn't produce any data for one tile or another. But that has since changed to account for prefetch tiles, see #1871. |
Tile masks were being rendered into the stencil buffer in whatever order they ended up in
RenderTiles
. When multiple sources are present, this can result in lower-detail tiles blocking higher-detail ones from rendering.