Clip y=sin(x) to pixel boundaries in a fragment shader, use Green’s Theorem to calculate pixel square coverage.
-
-
-
Replying to @Gankra_
Arcs or Bezier curves can be handled similarly as long as you can clip them to the pixel square.
1 reply 0 retweets 0 likes -
Replying to @pcwalton
I’d like to try replacing all the SDF antialiasing code in WebRender with Green’s Theorem based AA at some point.
2 replies 0 retweets 2 likes -
Replying to @pcwalton
What benefits would that provide? Decomplexity? Performance? Sanity? :D
1 reply 0 retweets 0 likes -
Replying to @jarrednicholls
Correctness. Using distance as a proxy for area is just wrong.
1 reply 0 retweets 0 likes -
-
-
Replying to @jarrednicholls
SDFs are faster. Distance is easily to calculate. Shoelace formula requires sum of 5 determinants.
1 reply 0 retweets 1 like -
Replying to @pcwalton @jarrednicholls
I think in this specific case -- 45 deg \_/ -- the error is minimal enough to ignore? (also most wavy lines from gecko have no AA at all)
1 reply 0 retweets 1 like
Well, for no AA don't use an SDF, just implicitize the curve :)
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.