CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.62k stars 3.42k forks source link

Default imagery sampling creates artifact seams #6190

Open mramato opened 6 years ago

mramato commented 6 years ago

Almost all tiled imagery in Cesium displays seams at some tile boundaries. I've noticed this issue for the last few years but always thought it was a tiling/data bug. Here's an example using the Earth at Night.

image

It turns out that the above seam is only there because we do linear sampling and tile boundaries don't take into account their adjacent tiles. Setting layer.magnificationFilter = TextureMagnificationFilter.NEAREST causes the issue to disappear but obviously creates blocky imagery and ugly labels for layers with text, like like Bing Aerial with labels.

image

Here's another example with bing:

Linear

image

Nearest

image

I'm not sure what a good solution would be (or if it is solving this is even possible) but wanted to raise the issue because it "presents itself" as a bug. One idea @bagnell had would be to support a mode where imagery tiles contain an extra row of pixels around the edges so that sampling would work there, but that would be non-standard and what work with any of the existing imagery in the wild.

spencerparkin commented 5 years ago

Is the following screen-shot another instance of this problem?

screenshot4

Maybe I need to disable lighting normals?

Actually, maybe this is a problem with the provided images? Maybe one LOD level is lighter than another?

mramato commented 5 years ago

@spencerparkin that's a different issue and looks like the problem is as you suspect, the lower LOD image is lighter than the higher one (but it's hard to say without knowing more). If you disable lighting and the problem goes away, that sounds like an unrelated bug in Cesium. If the problem is still there (i.e. a lighter patch) then it's definitely the data. Give it a try and open a new issue if you think it's a Cesium issue. Thanks

likangning93 commented 5 years ago

One idea @bagnell had would be to support a mode where imagery tiles contain an extra row of pixels around the edges so that sampling would work there, but that would be non-standard and what work with any of the existing imagery in the wild.

https://github.com/AnalyticalGraphicsInc/cesium/pull/7438 contains some machinery that might be helpful for this, since a large part of that PR is generating single geographic tiles that draw from multiple tiles in a more exotic projection.