Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Black annotations/images on certain zoom levels #10829

Open
LukasPaczos opened this issue Jan 4, 2018 · 21 comments
Open

Black annotations/images on certain zoom levels #10829

LukasPaczos opened this issue Jan 4, 2018 · 21 comments
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl

Comments

@LukasPaczos
Copy link
Member

LukasPaczos commented Jan 4, 2018

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 LukasPaczos added Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl labels Jan 4, 2018
@LukasPaczos LukasPaczos changed the title Black annotations/images Black annotations/images on certain zoom levels Jan 4, 2018
@dylan-chong
Copy link

dylan-chong commented Jan 11, 2018

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

@JustSayBien
Copy link

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

@tStaiger
Copy link

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

@LukasPaczos
Copy link
Member Author

LukasPaczos commented Jan 16, 2018

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?

@JustSayBien
Copy link

Hi @LukasPaczos,

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

@dylan-chong
Copy link

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
Copy link

Another device was a Galaxy S6.

@andrei-cimpan
Copy link

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

@LukasPaczos
Copy link
Member Author

LukasPaczos commented Jan 23, 2018

@andrei-cimpan your issue should be fixed with #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!

@philemonmerlet
Copy link
Contributor

Hello, is this bug still under investigation ? We are experiencing the same bug in 6.3.0 version. We opened a new issue ( #12671 ) but it was linked to this one and closed.
For us this is a blocking issue for integrating this version.
Thanks !

@andrei-cimpan
Copy link

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

@philemonmerlet
Copy link
Contributor

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

@accursedm0
Copy link

+1 Same here, using Mapbox SDK 6.2.1

@tobrun
Copy link
Member

tobrun commented Nov 22, 2018

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)

@stale
Copy link

stale bot commented May 21, 2019

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 stale bot closed this as completed May 21, 2019
@LukasPaczos LukasPaczos reopened this May 21, 2019
@stale stale bot removed the archived Archived because of inactivity label May 21, 2019
@mattijsf
Copy link

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 🥇

@silviokuehn
Copy link

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)

@LocusLabsGit
Copy link

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.

@ystsoi
Copy link

ystsoi commented Sep 13, 2020

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 (ystsoi@abf9cce). This solves the marker issue in emulators! As the texture pool is disabled, I also tried to prevent creating some textures unnecessarily (ystsoi@f4cdc90).

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.

@sbma44
Copy link
Member

sbma44 commented Mar 8, 2021

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.

@devthejo
Copy link

devthejo commented Dec 9, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests