Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metal: Incorrect reuse of sprites for line-pattern #2735

Closed
chchrn opened this issue Aug 19, 2024 · 15 comments · Fixed by #2908
Closed

Metal: Incorrect reuse of sprites for line-pattern #2735

chchrn opened this issue Aug 19, 2024 · 15 comments · Fixed by #2908
Assignees
Labels
bug Something isn't working metal

Comments

@chchrn
Copy link

chchrn commented Aug 19, 2024

Describe the bug

In our product we use a style with line-pattern. In versions that use MetalKit for map rendering we noticed a problem with filling lines with pattern.

I have prepared a test project demonstrating the problem (attached).

The project style is available in style.json file or at https://api.npoint.io/7dac9318bfb95b18a9dc.

The example uses a simple geojson with two lines, one should be filled with a black dashed line and the other with yellow icons.

On a small zoom everything shows up as it should, but if you zoom in on the map you can see that the styles get mixed up.
The yellow line starts to appear as a black dashed line and vice versa.

The problem seems to be the reuse of sprites.

We have only noticed this problem for the line-pattern property.

Before using the pre-metalKit version, we had no problems. The problem persists on the latest version 6.5.4 , and is also definitely present on 6.5.0

MlnPatterBug.zip

Screenshots
photo_2024-08-19 19 10 45
photo_2024-08-19 19 10 47
photo_2024-08-19 19 10 50

Platform information (please complete the following information):

  • OS: iOS
  • Platform: iOS
  • Version: 6.5.4
@chchrn chchrn added the bug Something isn't working label Aug 19, 2024
@louwers louwers added the metal label Aug 19, 2024
@louwers
Copy link
Collaborator

louwers commented Aug 19, 2024

Thanks for the bug report. I'll have a look if I can create a render test for this.

@louwers louwers changed the title MetalKit: Incorrect reuse of sprites for line-pattern Metal: Incorrect reuse of sprites for line-pattern Aug 23, 2024
@moodstubos
Copy link

We have the same problem with current Android release: android-v11.1.0

@sjg-wdw
Copy link
Collaborator

sjg-wdw commented Sep 17, 2024

@alexcristici see if you can fix this and ideally create a test for it.

@chchrn
Copy link
Author

chchrn commented Oct 1, 2024

@alexcristici how can I help with finding the bug? Do you have any idea what the bug might be?

@chchrn chchrn closed this as completed Oct 1, 2024
@chchrn chchrn reopened this Oct 1, 2024
@alexcristici
Copy link
Collaborator

@chchrn I'm investigating the pattern_from and pattern_to data driven attribute buffers.

@iwo
Copy link

iwo commented Oct 4, 2024

This issue is probably a root cause of #2621

It can easily be reproduced on Android (both real device and emulator) using the minimalistic sample style provided above.

@TimSylvester I see you recently worked on LineLayerTweaker, maybe you could help with this bug?

@TimSylvester
Copy link
Collaborator

TimSylvester commented Oct 4, 2024

I don't think it's just the pattern coordinates getting mixed up, the geometry seems to be wrong. Somehow a drawable is ending up with positions, and their matching texture coordinates, from both lines. I think that points to a problem in the bucket.

Scratch that, it seems to be normal to add geometry outside the tile and rely on stencil clipping to draw the right part in each tile.

image

@iwo
Copy link

iwo commented Oct 9, 2024

Great! The fix resolved our issues 🎉

@louwers what's your release schedule i.e. when will the fix go live?

@louwers
Copy link
Collaborator

louwers commented Oct 9, 2024

@iwo Nice. 🙂 I can make a release today.

@iwo
Copy link

iwo commented Oct 14, 2024

Hi @louwers, I see you made a release of Android v10 branch but I don't see android-v11.5.2. Are you planning to make it soon? Is there some there some problem with making this release?

@louwers
Copy link
Collaborator

louwers commented Oct 14, 2024

There is no problem, releases can be made on request. Happy to make a release for Android with this fix as well.

@iwo
Copy link

iwo commented Oct 14, 2024

It would be great if you could make it then :-)
We keep getting reports from prod users about this issue.

@louwers
Copy link
Collaborator

louwers commented Oct 14, 2024

Will be released later today.

@iwo
Copy link

iwo commented Oct 18, 2024

Hey @louwers, any update on the release?

@louwers
Copy link
Collaborator

louwers commented Oct 25, 2024

There was an issue with the release @iwo, but it is out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants