Closed AlexanderBelokon closed 2 years ago
I noticed that even without exaggerated terrain (and even without any extrusions at all) the seams that are apparent here (around the polar cap and above iceland) are sometimes visible as hairlines, sometimes only a few transparent dots here and there, sometimes as almost complete single-pixel transparent lines. Extrusions just make them easier to notice.
https://user-images.githubusercontent.com/2198527/175432229-6b3b6be3-32f0-44f9-a215-d2264f769189.mp4
I noticed that even without exaggerated terrain (and even without any extrusions at all) the seams that are apparent here (around the polar cap and above iceland) are sometimes visible as hairlines, sometimes only a few transparent dots here and there, sometimes as almost complete single-pixel transparent lines. Extrusions just make them easier to notice.
This looks like https://github.com/mapbox/mapbox-gl-js/issues/11858, good to note that the issue is heightened with terrain.
I think this issue is a result of two problems:
1) When creating tiles for greenlandish latitudes, normals for boundary points are calculated without taking into account neighboring tiles, making them too perpendicular to the globe, and as a result, accumulating errors with any exagerration. This might be fixed if we take more points on the other side of the tile into accont and make sure that normals on both sides of the tile boundary are pointing in the same direction.
2) When creating the cap for the pole, the cap's origin is located somewhere close to the pole, and to make it aligned with the rest of the sphere it is given a slight negative altitude that is amplified by the exagerration. This may be fixed if we move the origin for each of the cap's triangles to the outer rim of the cap, making negative altitude unnecessary.
mapbox-gl-js version: 2.9.1
browser: Firefox 101.0.1
Steps to Trigger Behavior
globe
projection by default)3D -> 3D Terrain -> Enable terrain -> On
3D -> 3D Terrain -> Exagerration -> 1000
Link to Demonstration
Shared style
https://user-images.githubusercontent.com/2198527/175383574-88e05138-303d-449b-a4cf-39c7d22e83d3.mp4
https://user-images.githubusercontent.com/2198527/175384583-825fa272-4b53-4938-b2e8-80506d3523b2.mp4
Expected Behavior
Globe does not have holes
Actual Behavior
Globe has holes