davenquinn / cesium-martini

On-the-fly meshing of raster elevation tiles for the CesiumJS virtual globe
MIT License
81 stars 17 forks source link

Globe caps #9

Closed davenquinn closed 2 years ago

davenquinn commented 2 years ago

One major element of this terrain provider that is lacking currently is the fact that there are enormous holes at the poles. This is true of all tiled terrain providers from Cesium that use the web mercator tiling scheme. Cesium's own CesiumTerrainProvider does not suffer from this issue, because tiles extend to the poles. We need to figure out how to add caps to the globe in order to make low zooms not look jarring. One possibility would be to just extend the northernmost tile to the pole. I think imagery would stretch atop it to make the globe look relatively seamless.

image
Zemledelec commented 2 years ago

Hi @davenquinn! Interesting pole areas for me too! I'd like to propose a couple solutions, suppose you already know how to improve it with basic caps, but let me guess, the first is to implement the same rendering algorithm as you do in mercator area but for the poles areas in EPSG4326. Your parent extend should be North:[[-180, ~85],[180, 90]] and South: [[-180, -90], [180, ~-85]], and you can even implement some terrain and imagery data here but in 4326 proj. The second is to implement quad tree for polar projection, I think which is more preferable in this case, but more difficult!

davenquinn commented 2 years ago

Hi @Zemledelec, thanks for the input! Right now, I am not too worried about accurate terrain for polar regions, which would require new quadtrees, but just a rendering fix for this issue at low zooms. I'm just not sure how to "implement the rendering algorithm" in the Cesium context.

It seems ideal to just create a single "cap" mesh that we insert at low zoom levels. But I don't know how to handle this (so far, this tile provider just gives meshes corresponding to each tile to Cesium)... and am poorly equipped to dig into the rendering guts here. Maybe I can just extend the built mesh for the polar-most tile of each quadtree all the way to the pole? I don't know if that's supported.

Honestly, it seems like this should be built into Cesium's tiled elevation providers. But I understand that they want to push people to use their hosted, prebuilt meshes.