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

Rendering artifacts with sdf icons #14809

Closed
LukasPaczos opened this issue May 31, 2019 · 6 comments · Fixed by #15456
Closed

Rendering artifacts with sdf icons #14809

LukasPaczos opened this issue May 31, 2019 · 6 comments · Fixed by #15456
Assignees
Labels
bug Core The cross-platform C++ core, aka mbgl high priority

Comments

@LukasPaczos
Copy link
Contributor

LukasPaczos commented May 31, 2019

Refs mapbox/mapbox-plugins-android#971.

Whenever an SDF icon is laid out on the same tile (group of tiles?) as a non-SDF icon, the non-SDF becomes SDF as well and changes its color to the color of the SDF and has troubles rendering which can be seen in mapbox/mapbox-plugins-android#971 (lags when animating).

The reproducible case below - https://github.com/mapbox/mapbox-gl-native/tree/lp-sdf-artifacts-repro

ezgif com-video-to-gif (47)

Above uses maki, but also reproducible when explicitly adding a non-sdf icon:

Feature feature1 = Feature.fromGeometry(Point.fromLngLat(16, 50));
feature1.addStringProperty("icon", "non-sdf-image");

Feature feature2 = Feature.fromGeometry(Point.fromLngLat(-15, 40));
feature2.addStringProperty("icon", "sdf-image");

Bitmap bitmap = BitmapUtils.getBitmapFromDrawable(ContextCompat.getDrawable(SimpleMapActivity.this,
  R.drawable.mapbox_user_puck_icon));
if (bitmap != null) {
  style.addImage("sdf-image", bitmap, true /*SDF*/);
}

Bitmap bitmap1 = BitmapUtils.getBitmapFromDrawable(ContextCompat.getDrawable(SimpleMapActivity.this,
  R.drawable.mapbox_user_puck_icon));
if (bitmap1 != null) {
  style.addImage("non-sdf-image", bitmap1, false /*NON-SDF*/);
}
@LukasPaczos LukasPaczos added the Core The cross-platform C++ core, aka mbgl label May 31, 2019
@LukasPaczos
Copy link
Contributor Author

I went as far back as 7.1.0 and the issue was still reproducible.

/cc @tmpsantos

@LukasPaczos
Copy link
Contributor Author

has troubles rendering which can be seen in mapbox/mapbox-plugins-android#971 (lags when animating)

Reopening because even though the icons are not treated as SDFs visually, the rendering performance is still impacted. See mapbox/mapbox-plugins-android#971 (comment).

If the layer contains only SDF icons or only non-SDF icons the performance is fine, we're running into the issue again only when there's a mix of SDF and non-SDF icons on the same layer.

@LukasPaczos LukasPaczos reopened this Aug 28, 2019
@alexshalamov
Copy link
Contributor

@LukasPaczos should we split this issue into two? Issue with mixing sdf and non-sdf icons and applying color is one issue. Performance lag is another issue that should be investigated separately.

@zmiao what do you think?

@zmiao
Copy link
Contributor

zmiao commented Aug 28, 2019

I agree with @alexshalamov, the lagging issue could be handled separately, is it fine for you @LukasPaczos ?

@LukasPaczos
Copy link
Contributor Author

LukasPaczos commented Aug 28, 2019

Sure, let me cut a new ticket 👍

@LukasPaczos
Copy link
Contributor Author

Continuing in #15509.

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

Successfully merging a pull request may close this issue.

4 participants