Whenever I draw a polygon using opengl the edges look bad because straight lines look bad. I want the edges to have nice soft antialiased edges but that's not how opengl draws polygons. Multisampling AA doesn't help as much as I expect it to.
-
Show this thread
-
Replying to @mcclure111
a surprising amount of code in solvespace exists solely to draw antialiased edges with shaders. i don't understand most of it
2 replies 0 retweets 14 likes -
Replying to @whitequark @mcclure111
I have literally spent the last two years of my career on this problem. :)
2 replies 3 retweets 13 likes -
Replying to @pcwalton @whitequark
i was hoping i could implement it in like maybe a week as part of this 6 month project >_>
1 reply 0 retweets 5 likes -
Replying to @mcclure111 @whitequark
Check out https://github.com/pcwalton/pathfinder/blob/pf3/resources/shaders/fill.fs.glsl … — not as well documented as it could be (hoping to write a blog post soon), but maybe it’ll be helpful.
1 reply 0 retweets 8 likes
An alternate simpler approach is just to calculate the distance to the line. But you need a good area approximation formula for this to look good (area determines the shade of gray, not distance—common mistake). I created one with some statistics here: https://github.com/servo/webrender/blob/ad6cec76254030e8fcc4e6c7e5e300c69b6d36ca/webrender/res/shared.glsl#L91 …
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.