deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

BitmapLayer world copies don't blend with vector GoogleMapsOverlay

Open zakjan opened this issue 4 years ago • 13 comments

Description

Steps:

  • vector GoogleMapsOverlay
  • BitmapLayer with opacity <1
  • zoomed out viewState so that multiple world copies are visible

The first world copy of BitmapLayer blends well. The other world copies don't blend.

Screen Shot 2021-10-12 at 21 31 12

Expected Behavior

All BitmapLayer world copies blend well.

Repro Steps

https://codepen.io/zakjan/pen/yLXPWNe

Environment

  • Framework Version: 8.6.0
  • Browser Version: Chrome 94

zakjan avatar Oct 12 '21 19:10 zakjan

If you add

    parameters: {
      depthMask: false,
    },

To the layer, it renders as expected.

@felixpalmer Can you report this to Google and get some clarifications on how we should project extra world copies?

Pessimistress avatar Oct 13 '21 16:10 Pessimistress

Interesting, when I add this, the extra copies start blending, but each copy with a different effective opacity. As if each copy is also repeated itself inside, and they get overlaid.

However, there is no MapView({ repeat: true }). Is it because Google Maps automatically renders the copies, and deck doesn't have any control about it?

Screen Shot 2021-10-14 at 7 00 12

zakjan avatar Oct 14 '21 05:10 zakjan

MapView({ repeat: true }) is the default view of GoogleMapsOverlay. It's not clear to me how Google Maps handles the repeat, maybe they duplicate the custom overlay as part of a "copy"? Is the custom overlay drawn once for the main copy, or once for each copy, or after all copies are drawn? Should we just draw one copy instead of repeating? What about 3D objects then?

Pessimistress avatar Oct 14 '21 07:10 Pessimistress

MapView({ repeat: true }) is the default view of GoogleMapsOverlay.

Ah I see, here it is. https://github.com/visgl/deck.gl/blob/755b2768c21f4d2a5983002c79e7099704d9c776/modules/google-maps/src/utils.js#L201

zakjan avatar Oct 14 '21 07:10 zakjan

Update: this issue has been reported to Google Maps team, they're going to investigate further, we'll keep you posted once we've more info

alasarr avatar Oct 21 '21 10:10 alasarr

Are there any news about this issue from Google Maps team?

For now, there is a workaround of using latest deck.gl with @deck.gl/google-maps 8.5.0, but I'm worried about a potential compatibility breaking change in future releases.

zakjan avatar Mar 03 '22 09:03 zakjan

I've done some experimenting and it isn't just the BitmapLayer, I also see this with the ScenegraphLayer, i.e. with 3D objects. It doesn't appear to be the case that there is some copy happening, but the opacity is different

https://user-images.githubusercontent.com/453755/157007797-1b827967-effe-404c-bee0-55c1f0c88b5f.mov

.

felixpalmer avatar Mar 07 '22 09:03 felixpalmer

@amuramoto you can find a demo of the above bug here: https://jsfiddle.net/felixp/ac20sfqd/

felixpalmer avatar Mar 10 '22 09:03 felixpalmer

Considering that this is outside of deck control, is it possible to bring back the overlaid mode from <=8.5.0, and allow developers to choose? Related to https://github.com/visgl/deck.gl/issues/6773

zakjan avatar Apr 01 '22 15:04 zakjan

@zakjan I've put a together a PR for this

felixpalmer avatar Apr 05 '22 15:04 felixpalmer

Google has just confirmed it's been fixed, I've tested the codepen and it works (depthMask true or false) for me. @zakjan feel free to re-open if you see something wrong

alasarr avatar May 09 '22 16:05 alasarr

Thanks @alasarr for tracking this, but it seems that the fix from Google is not released yet?

The codepen was created with deck.gl 8.6.0, which looked for the old google.maps.WebglOverlayView, but the beta channel now has google.maps.WebGLOverlayView. Opening the codepen now falls back to the raster mode. Upgrading the codepen to 8.6.7+ (with #6579) triggers the bug again. @felixpalmer's demo with 8.7.0 keeps showing the bug as well.

Screenshot 2022-06-03 at 13 44 51 Screenshot 2022-06-03 at 13 48 14

zakjan avatar Jun 03 '22 11:06 zakjan

Reopening as the bug is still present: https://jsfiddle.net/felixp/ac20sfqd/

felixpalmer avatar Jun 28 '22 20:06 felixpalmer