mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

Black annotations/images on certain zoom levels

Open LukasPaczos opened this issue 7 years ago • 21 comments

When running the test app on an emulator (8.1.0 or 4.4) I'm running into issues with gl rendered images, markers and labels. black annotations black annotations 2

I wasn't able to reproduce this on a physical device running 6.0.1. Also, looks like it's only in SDK versions 5.2.0 and upwards, I wasn't able to reproduce the issue on an emulator running 5.1.5.

LukasPaczos avatar Jan 04 '18 13:01 LukasPaczos

This happened on android devices on 8.1, 6.0.1, 7.0, mapbox 5.1.4

dylan-chong avatar Jan 11 '18 01:01 dylan-chong

I'm also seeing this with mapbox 5.3.1 on Android Version 8.x and 7.x

JustSayBien avatar Jan 16 '18 13:01 JustSayBien

I'm also seeing this on Android 8.x, 7.x with mapbox 5.3.1

tStaiger avatar Jan 16 '18 13:01 tStaiger

Thanks for your input @dylan-chong, @JustSayBien and @tStaiger. Were you using emulators or physical devices? If the latter, could you let us know which phone models did you use for testing?

LukasPaczos avatar Jan 16 '18 14:01 LukasPaczos

Hi @LukasPaczos,

i tested on emulators and was not able to reproduce this issue on a physical device.

JustSayBien avatar Jan 16 '18 14:01 JustSayBien

One of the devices was a nexus 6P.

I remember you must add lots of markers to the map for the bug to happen,, but it seems to be not happen to me on android 5.2.1, just 5.1.4

dylan-chong avatar Jan 16 '18 17:01 dylan-chong

Another device was a Galaxy S6.

dylan-chong avatar Jan 16 '18 17:01 dylan-chong

Happens to me also on emulators. Also, since I updated the SDK to 5.3.1 from 5.2.0 (needed that for the attribution button exposed classes), the annotations flicker once on physical devices. I'm using ObjectAnimator's ability to modify the position attribute and move a Marker along with the camera

andrei-cimpan avatar Jan 23 '18 14:01 andrei-cimpan

@andrei-cimpan your issue should be fixed with https://github.com/mapbox/mapbox-gl-native/pull/10899 that will be included in our 6.0.0 release. In the mean time, could you re-test this with 6.0.0-SNAPSHOT? If you will still be able to reproduce the flickering, please create a new issue. Thanks!

LukasPaczos avatar Jan 23 '18 15:01 LukasPaczos

Hello, is this bug still under investigation ? We are experiencing the same bug in 6.3.0 version. We opened a new issue ( https://github.com/mapbox/mapbox-gl-native/issues/12671 ) but it was linked to this one and closed. For us this is a blocking issue for integrating this version. Thanks !

philemonmerlet avatar Aug 30 '18 08:08 philemonmerlet

@philemonmerlet I have this issue only while using ProGuard. I've added -keep for mapbox and works fine now. using version 6.4.0

andrei-cimpan avatar Aug 30 '18 08:08 andrei-cimpan

Thanks for your feedback, unfortunately in our case we were not using proguard.

philemonmerlet avatar Aug 30 '18 16:08 philemonmerlet

+1 Same here, using Mapbox SDK 6.2.1

accursedm0 avatar Oct 02 '18 13:10 accursedm0

Capturing from an user that the following configuration is working well for them:

OpenGL ES renderer: SwiftShader
OpenGL ES API level: Render maximum (up to OpenGL ES 3.1)

tobrun avatar Nov 22 '18 12:11 tobrun

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

stale[bot] avatar May 21 '19 14:05 stale[bot]

Confirmed that configuring SwiftShader fixes the black assets on the map. However it drastically decreases performance of the emulator (tested on macOS) I hope this can be fixed for the native renderer some day 🥇

mattijsf avatar Jun 26 '19 07:06 mattijsf

Capturing from an user that the following configuration is working well for them:

OpenGL ES renderer: SwiftShader
OpenGL ES API level: Render maximum (up to OpenGL ES 3.1)

This worked for me. Thank you!

In Android Manifest I added: <uses-feature android:glEsVersion="0x00030001" android:required="true" />

And in config.ini of my emulator I added:

hw.gpu.enabled=yes
hw.gpu.mode=swiftshader_indirect

(Using a MacBook Pro 15 from 2018)

silviokuehn avatar Nov 12 '19 10:11 silviokuehn

I tried adding

But it didn't work.

I saw the advice above about adding properties to config.ini but I don't know where to find the config.ini file and I couldn't easily find relevant documentation about it.

LocusLabsGit avatar Apr 03 '20 18:04 LocusLabsGit

I found that simply modifying a marker can make it gray in an emulator. And I have prepared a simple program to reproduce this issue: https://github.com/ystsoi/mapbox-gl-native/tree/test-emulator-marker-issue/TestEmulatorMarkerIssue

Tapping the "Show/Update Marker" button once will show a marker. Tapping the button again will change its size, which will make it gray in an emulator.

After tracing, I noticed that when creating a texture for an icon atlas image (https://github.com/ystsoi/mapbox-gl-native/blob/ae4a0c3ee3c9aadabb49f607425920ce38a53ec9/src/mbgl/tile/geometry_tile.cpp#L97), an old texture id for a glyph atlas image (https://github.com/ystsoi/mapbox-gl-native/blob/ae4a0c3ee3c9aadabb49f607425920ce38a53ec9/src/mbgl/tile/geometry_tile.cpp#L92) may be reused. I also noticed that the formats of the images are different.

I suspected that this may cause the issue, so I tried to disable the texture pool (https://github.com/ystsoi/mapbox-gl-native/commit/abf9cceaa5232adfb571210445c7a50570d9c5fd). This solves the marker issue in emulators! As the texture pool is disabled, I also tried to prevent creating some textures unnecessarily (https://github.com/ystsoi/mapbox-gl-native/commit/f4cdc901aa3debfb7c418c0fd16e8fe28efa8b3f).

In fact, I am not familiar with OpenGL, see whether this finding helps to solve the issue, or whether this helps to confirm a bug in the emulator.

ystsoi avatar Sep 13 '20 06:09 ystsoi

Although we believe this issue can be caused by a variety of factors and configurations unrelated to Mapbox software, we've had customers report positive outcomes when switching their emulator settings to use software rendering. This comes at a performance cost, but should avoid some GPU/driver problems in specific development environments. At the risk of stating the obvious: we don't believe this issue occurs anywhere but the emulator.

sbma44 avatar Mar 08 '21 14:03 sbma44

thanks @silviokuehn this worked for me on Linux Mint 20.2 :

In Android Manifest:

<uses-feature android:glEsVersion="0x00030001" android:required="true" />

And in config.ini of emulator:

hw.gpu.enabled=yes
hw.gpu.mode=swiftshader_indirect

@LocusLabsGit the config.ini is related to avd, on linux it can be found at ~/.android/avd/emulator.avd/config.ini where emulator is the name of the emulator device in my case it's ~/.android/avd/Nexus_5_API_30.avd/config.ini

devthejo avatar Dec 09 '21 13:12 devthejo