mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

Overdraw (reporting?) issue Android SDK

Open florianPOLARSTEPS opened this issue 3 years ago • 1 comments

Environment

  • Android OS version: Irrelevant
  • Devices affected: Irrelevant
  • Maps SDK Version: 10.2.0

Observed behavior and steps to reproduce

I am doing some performance improvements on my map setup and started looking into overdraw on the map. For my usecase I have to basically combine a vector style map and a satellite style map.

The style setup is as follows.

- Common layers
- Raster satellite layer
- Black background layer 
- Vector layers

The Raster satellite layer and the Black background layer slowly fade out at a certain zoom level (opacity 1 -> 0) so only the Vector layers and Common layers are visible once the map is zoomed in far enough.

Mapbox studio

Now if I look at Mapbox studios Overdraw inspector the map seems to be smart enough to not draw any layers that are completely blocked by the satellite layers and only once the satellite layers start fading out, it will start drawing them.

https://user-images.githubusercontent.com/21218132/151760714-da42d1ff-7c19-4411-a804-a6dfa96644a5.mov

Android SDK

If I enable the same debugging feature in the Android SDK mapboxMap.setDebug(listOf(MapDebugOptions.OVERDRAW), true) the behaviour is different and I can see that the Vector layers are drawn at all zoom levels which of course is a big performance hit.

https://user-images.githubusercontent.com/21218132/151762150-f9da74de-5ca7-44ac-8883-9a5be87964c5.mp4

I know there are many possible solutions to the problem (simplest would be to just hide/filter layers until I am going to render them) but this is still an issue in my view.

Expected behavior

No overdraw of layers that are completely blocked by other layers (Background/ Satellite). Reporting and map behavior should be consistent in mapbox studio/ the SDKS

Notes / preliminary analysis

I do not know where exactly the problem lies, either by the debug features which could be implemented differently in studio and the sdk or if it's actually an overdrawing issue in the SDK.

florianPOLARSTEPS avatar Jan 31 '22 08:01 florianPOLARSTEPS

@florianPOLARSTEPS thank you for reporting this. I was able to reproduce this behavior and will investigate the root cause.

ZiZasaurus avatar Feb 01 '22 14:02 ZiZasaurus