-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 ocean tiles #12279
Fix missing ocean tiles #12279
Conversation
@avpeery I haven't been able to reproduce from my machine with this new epsilon value. Before moving this forward, it would be worth doing two things:
|
@@ -260,7 +260,8 @@ export class Terrain extends Elevation { | |||
this._sourceTilesOverlap = {}; | |||
this.proxySourceCache = new ProxySourceCache(style.map); | |||
this.orthoMatrix = mat4.create(); | |||
mat4.ortho(this.orthoMatrix, 0, EXTENT, 0, EXTENT, 0, 1); | |||
const epsilon = this.painter.transform.projection.name === 'globe' ? .015 : 0; // Experimentally the smallest value to avoid rendering artifacts (https://github.com/mapbox/mapbox-gl-js/issues/11975) |
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.
Do we also need to check for terrain here?
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.
I'm not seeing the missing tile with terrain (no globe) with this fix, but will test out on various devices! I also hit a failed render test when I removed the globe check (no significant difference though)
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.
Here's a codesandbox with this change
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.
LGTM. Tested on both chrome iPhone se and macOS.
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.
Looks good to me! Tested on Linux, Windows and Android.
Fixes #11975. Similar logic to PR #12203, but epsilon value is only applied when globe projection and to the left bound (see definition for mat4.ortho here)
Test with codesandbox on different devices, many thanks!
Launch Checklist
mapbox-gl-js
changelog:<changelog>Fix missing ocean tiles when globe is enabled.</changelog>