-
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
[MAPS3D-425] introduce skirts for globe rendering #12523
Conversation
Case with transparent textures not handled -> update with moving skirts to be rendered last will be made |
src/geo/projection/globe_util.js
Outdated
// gridIndices: TriangleIndexArray, | ||
// gridSegments: Array<SegmentVector> | ||
// }; | ||
_fillGridMeshWithLods(longitudinalCellsCount: number, latitudinalLods: number[], hasStrip: boolean): GridWithLods { |
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.
Nit: should we eliminate the hasStrip
flag since it's always true? (I guess this a debugging leftover?)
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 have removed the flag from the interface, but kept it internal for potential debug uses
f3694e9
to
7c8e08d
Compare
7a6ac35
to
3c97bdd
Compare
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 noticed some areas where the skirt might be missing.
pole_skirts_missing.mov
src/terrain/draw_terrain_raster.js
Outdated
const skirtHeightValue = Math.min(skirtHeight(tr.zoom) * terrain.exaggeration(), 20000); | ||
|
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.
How was the value "20000" chosen?
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.
heuristically, without the limiting factor on certain zoom levels, e.g. 1.5 +- there can be seen triangles penetrating the earth surface. It was revealed by the globe anti-aliasing test with extreme exaggerations
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 the opposite side of the globe? What are the implications of triangles penetrating the surface?
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.
Fixed
src/geo/projection/globe_util.js
Outdated
indices.emplaceBack(idx + offsetToNextRow, idx + offsetToNextRow + 1, idx + 1); | ||
} | ||
} | ||
segments.push(SegmentVector.simpleSegment(0, indexOffset, vertices.length, indices.length - indexOffset)); |
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.
Are you including skirt triangles into the same segment as the main grid triangles? We could have two different segments: one with skirts and one without skirts. This way we can skip rendering of skirts if the terrain is not enabled (or exaggeration is 0) in globe view.
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.
If I understood correctly this change will always render skirts?
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.
would it be possible to construct index buffer so that skirt triangles are immediately after terrain triangles? This wouldn't increase draw count as the only difference would be the number of rendered indices?
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.
currently, always, but yeah two segments (one with skirt and one without) can be used depending on terrain exaggeration. I'll do that modification
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.
Done
5e568a5
to
e785d9f
Compare
Thanks for addressing the review comments @alexey-romanov! Code changes looks good to me but unfortunately there are still some scenarios where the skirt geometry is missing. It is also possible to see gaps when zooming in and out rapidly as I wrote previously. I would suggest fixing remaining issues where gaps are visible even when camera is not moving. We can defer rest of the cases to a follow-up PR. |
|
I was able to repro it locally. It is related to the case of transition between globe and mercator |
Absent skirts lead to holes for hight exaggerated terrain in globe mode.
e785d9f
to
77757cf
Compare
Should be fixed now |
Absent skirts lead to holes for hight exaggerated terrain in globe mode.
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>introduce skirts for terrain globe mode</changelog>