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

Areas covered by "n % 8 == 0" polygons are not drawn #2269

Closed
outlandnish opened this issue Mar 15, 2016 · 5 comments · Fixed by #1606
Closed

Areas covered by "n % 8 == 0" polygons are not drawn #2269

outlandnish opened this issue Mar 15, 2016 · 5 comments · Fixed by #1606
Labels

Comments

@outlandnish
Copy link

On 0.15.0, we have some weird artifacts when multiple geometries on the same layer are rendered and happen to overlap each other.

screen shot 2016-03-14 at 11 04 42 pm

screen shot 2016-03-14 at 11 06 08 pm

You can also view it live at https://app.airmap.io and searching for Anchorage with Recreational - 5 mile radius airports turned on.

Any ideas?

@lucaswoj
Copy link
Contributor

Thanks for the report @NSamala. I can confirm the bug and will investigate as soon as I can.

@ansis
Copy link
Contributor

ansis commented Mar 17, 2016

Any spot covered by 0, 8, 16, 24, etc polygons doesn't correctly. This will be fixed by the switch to earcut #1606 . I don't think we can do anything before that to fix this.


We currently draw polygons by creating a stencil using the stencil buffer and then. We only use 3 of the bits of the stencil mask for polygon rendering because we use the rest for tile clipping masks. This means that if the number of polygons overlapping a pixels is a multiple of 8 then it will treat it as zero.

Removing the wrap from here doesn't fix the problem because the clamping is applied before the mask.

@ansis
Copy link
Contributor

ansis commented Mar 17, 2016

It looks like the second image may be of a different bug that we can fix pretty easily: #2089

@outlandnish
Copy link
Author

Thanks for the quick response! It does look like that earcut branch will solve both of these problems. For that second picture, would it work to ensure our polygons follow the proper winding order for their linear rings as a short term fix?

@lucaswoj lucaswoj changed the title Overlapping geometry on the same layer have bizarre clipping / rendering issues Areas covered by "n % 8 == 0" polygons are not drawn Mar 17, 2016
@ansis
Copy link
Contributor

ansis commented Mar 17, 2016

@NSamala yes, ensuring all your polygons follow the same winding order should fix it. This should be fixed in the next release: #2285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants