Skip to content
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

Imagery tiles requested when hidden behind other imagery #7728

Open
lilleyse opened this issue Apr 9, 2019 · 2 comments
Open

Imagery tiles requested when hidden behind other imagery #7728

lilleyse opened this issue Apr 9, 2019 · 2 comments

Comments

@lilleyse
Copy link
Contributor

lilleyse commented Apr 9, 2019

Imagery tiles are requested regardless of their visibility. If an imagery layer is below another opaque imagery layer its tiles will still get requested and rendered. Is it possible to detect this and not request those tiles?

Example:

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.imageryLayers.addImageryProvider(Cesium.createTileMapServiceImageryProvider({
    url : Cesium.buildModuleUrl('firstlayer')
}));
viewer.imageryLayers.addImageryProvider(Cesium.createTileMapServiceImageryProvider({
    url : Cesium.buildModuleUrl('secondlayer')
}));
@pjcozzi
Copy link
Contributor

pjcozzi commented Apr 9, 2019

Sometimes this is a "feature" to "prefetch" imagery layers, but I agree this would be a welcome optional optimizations that likely defaults to true. This dates back to #526.

@likangning93
Copy link
Contributor

Robustly deciding that an imagery tile is occluded is hard because the tile may have alpha and/or it may be in a weird custom projection (soon... hopefully).

But an approximation that helps determine priority is a lot more doable.

Some thoughts:

  • use an rbush of imagery layer rectangles, we can compute which rectangles collide with an imagery tile
  • from this we can compute how much of the tile's rectangle is occluded, this probably involves a bunch of recursive Rectangle intersection ops or something
  • or just prioritize based on Z-index when there are collisions at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants