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 pole geometry elevation sampling #12133
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpulkki-mapbox
force-pushed
the
mpulkki-fix-pole-elevation
branch
from
August 4, 2022 10:27
5a96e6f
to
2064edc
Compare
mpulkki-mapbox
changed the title
Fix pole geometry elevation sampling with exaggerated terrain
Fix pole geometry elevation sampling
Aug 4, 2022
mpulkki-mapbox
requested review from
karimnaaji and
akoylasar
and removed request for
karimnaaji
August 4, 2022 11:39
akoylasar
approved these changes
Aug 8, 2022
src/geo/projection/globe_util.js
Outdated
const point = tr.point; | ||
const ws = tr.worldSize; | ||
const s = tr.worldSize / (tr.tileSize * numTiles); | ||
const poleMatrix = calculateGlobeMatrix(tr); |
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.
we could use tr.globeMatrix
.
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.
good catch!
astojilj
approved these changes
Aug 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pole geometry in globe view is rendered by extrapolating vertex, elevation and color data from the bordering tiles. A triangle fan expanding towards either of the geographic poles is created for each tile without top or bottom neighbour
y == 0 || y == tiles - 1
.A bug was found where elevation of the pole geometry seems to be off when an exaggerated terrain is used with the
Terrain-DEM v1
source. After some investigation I found out that the metric elevation applied to pole vertices is in incorrect coordinate space.Terrain-RGB v1
source works fine as the elevation is always (observed to be) 0 for bordering tiles which is not the case with DEM v1.This PR fixes the following issues:
Two new render tests are added to validate the fix.
Partly fixes #12037.
Launch Checklist
@mapbox/map-design-team
@mapbox/static-apis
if this PR includes style spec API or visual changes@mapbox/gl-native
if this PR includes shader changes or needs a native portmapbox-gl-js
changelog:<changelog>Fix elevation of pole geometry when exaggerated terrain is used</changelog>