You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The minimum ALIASED_LINE_WIDTH_RANGE required by the spec is [1, 1]. We need at least a width of 2 for antialiasing to work. ANGLE only supports a width of 1. Angle is used in Chrome and Firefox on windows, and by our headless testing.
@kkaefer pointed out a potential technique for doing polygon antialiasing/stroking using barycentric coordinates, and I spent some time prototyping it in gl-js. It's a clever technique, but unfortunately it doesn't look like it will work for us. The technique originates as a way of drawing wireframes, where all three sides of each triangle are stroked. When you want to stroke only some of the sides, the issue arises that the edges that are not stroked end up "cutting off" pieces of the stroke on adjacent edges:
The skinnier the triangles, the worse this gets -- and earcut tends to generate a lot of very skinny triangles.
You could try to correct for this by shading portions of the other triangles that cover that border, but this doesn't seem straightforward, and I couldn't find any papers or threads online that discussed it.
A second issue with this technique is that it will only allow us to antialias or stroke the interior of the polygon. An interior-only antialiasing would likely produce or exacerbate seams between polygons that share an edge. What we really want is a 50/50 split between the interior and exterior, and to get that, we'd need to implement polygon outset, a complex algorithm.
I'm suffering from this issue also.
I found that setting a 1px stroke with 50% opacity of the same color solved the issue... but .. yeah, doesn't work as advertised.
Activity
ansis commentedon Feb 6, 2016
cc @kkaefer
lucaswoj commentedon Feb 8, 2016
Do you think this is the same phenomena as #1606 (comment)?
[-]antialias fills without gl.LINES[/-][+]Antialias fills without gl.LINES[/+]tmpsantos commentedon Jun 22, 2017
ANGLEis also used on Mapbox GL Native + Qt on Windows.jfirebaugh commentedon Jun 26, 2017
The core profile for desktop OpenGL on macOS supports only
[1, 1]as well: https://developer.apple.com/opengl/OpenGL-Capabilities-Tables.pdf.jfirebaugh commentedon Jun 26, 2017
Weirdly, support for >1 seems to have increased abrupt in recent months:
http://webglstats.com/webgl/parameter/ALIASED_LINE_WIDTH_RANGE
jfirebaugh commentedon Jul 17, 2017
@kkaefer pointed out a potential technique for doing polygon antialiasing/stroking using barycentric coordinates, and I spent some time prototyping it in gl-js. It's a clever technique, but unfortunately it doesn't look like it will work for us. The technique originates as a way of drawing wireframes, where all three sides of each triangle are stroked. When you want to stroke only some of the sides, the issue arises that the edges that are not stroked end up "cutting off" pieces of the stroke on adjacent edges:
The skinnier the triangles, the worse this gets -- and earcut tends to generate a lot of very skinny triangles.
You could try to correct for this by shading portions of the other triangles that cover that border, but this doesn't seem straightforward, and I couldn't find any papers or threads online that discussed it.
A second issue with this technique is that it will only allow us to antialias or stroke the interior of the polygon. An interior-only antialiasing would likely produce or exacerbate seams between polygons that share an edge. What we really want is a 50/50 split between the interior and exterior, and to get that, we'd need to implement polygon outset, a complex algorithm.
exotfboy commentedon May 24, 2018
Hi , I found that the
Antialiasalso does not work with thefill-extrusion.alphex commentedon Oct 25, 2022
I'm suffering from this issue also.
I found that setting a 1px stroke with 50% opacity of the same color solved the issue... but .. yeah, doesn't work as advertised.