3 ms·
As far as I know, you basically get to choose two of antialiasing quality, correctness, and performance. The viable antialiasing options for vectors are: 1. Su
by pcwalton 8y ago
As far as I know, you basically get to choose two of antialiasing quality, correctness, and performance. The viable antialiasing options for vectors are:
1. Supersampling/multisampling. This is what you suggested. This provides correctness with coincident edges, but 256xAA (what analytic AA gives you) is far too slow and memory intensive to be practical if you supersample. In general practical implementations of MSAA/SSAA are limited to 16xAA or so, which is a noticeable drop in quality and in fact is still pretty slow relative to a high-quality implementation of analytic AA.
2. Analytic antialiasing. This has problems with coincident edges, but in most cases the effects are minimal. The performance and quality are excellent if implemented properly.
I generally think that analytic AA is the right tradeoff for most applications. Subtle rendering problems on coincident edges are usually a small price to pay for the excellent results, and designers can work around those issues when they come up. A 100% theoretically correct rasterizer can't exist anyway, because of floating point/fixed point precision issues among other reasons.
- amelius 8y agoInteresting, this is new for me. Is it true that for analytic AA you'd have to consider the rendered objects all at once, instead of just rendering one after the other?
- pcwalton 8y agoUsually with analytic AA you just use Porter-Duff blending, because rendering all the objects simultaneously doesn't buy you much except for performance (which is why piet-metal does it that way). For supersampling AA you can render all the objects at once, like Flash did, and this does improve rendering quality around coincident edges. Oddly (in my opinion), some rasterizers such as Skia's use supersampling for individual paths and Porter-Duff blending when overlaying different paths on top of one another. This means that you don't have seams between subpaths of the same path, but different paths can have seams on coincident edges. I don't like this tradeoff personally, because it has a lot of the downsides of analytic AA without the benefit of antialiasing quality, but for better or worse this approach is widely used.
- amelius 8y agoOk. I personally think a 100% correct rendering would have great benefit. The coincident edge problem happens a lot, especially when the scene is computer-generated. Also when overlaying the same object a number of times exactly, the edges lose their AA property. (E.g. in Inkscape, draw a circle, copy it, then paste it exactly on top using ctrl+shift+V and repeat 20 times, and you see the edges becoming jagged).