-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Antialias fills without gl.LINES #2080
Comments
cc @kkaefer |
Do you think this is the same phenomena as #1606 (comment)? |
|
The core profile for desktop OpenGL on macOS supports only |
Weirdly, support for >1 seems to have increased abrupt in recent months: http://webglstats.com/webgl/parameter/ALIASED_LINE_WIDTH_RANGE |
@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. |
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.We should use triangles.
moving away from gl.LINES should fix #1047
It could also help without our headless testing antialiasing headaches.
The text was updated successfully, but these errors were encountered: