The problem with these sorts of analytical approaches is how to handle backgrounds, depth and intersections. There are good reasons why GPUs rely on variations of multisampling. Even CPU-based 3D render engines use similar methods rather than analytic filters, as far as I know. A more interesting approach to antialiasing, in my opinion, is the use of neural nets to generate aesthetically pleasing outputs from limited…
Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
61–70 of 86 posts
Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#62Earlier quoted context omitted.
Raph made an argument that Box is good enough for lots of things, which is subjective and depends entirely on what things you’re doing, and how much you actually care about quality. You are claiming it’s the best possible. Box filter is simply not the best possible, and this fact is well understood and documented. You can relax your claim to say it’s good enough for what you need, and I won’t disagree with you anymor…
Why do conflation artifacts always exist with a box filter? AFAIK conflation artifacts are a product of the compositing process, not the filtering process. If you have two non-overlapping shapes of the same color covering the plane and use a box filter on the first shape to sample a pixel on the boundary, and then use the same box filter on the second shape, and then composit them with alpha blending, you get a confl…
You can see this with a single sharp edge, it doesn’t need to involve multiple polygons, nor even vector rendering, it happens when downsampling images too.
Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#63Earlier quoted context omitted.
That isn’t true. Again, please look more closely at the first example in the article, and take the time to understand it. It demonstrates there’s a better method than what you’re suggesting, proving that clipping to pixels and summing the area is not the best visual quality you can get.
Backing up to your earlier comment. Pixels on some displays are in fact little squares of uniform color . The question then is how to color a pixel given geometry with detail within that square. All of this "filtering" is variations on adding blur. In fact the article extends the technique to deliberately blur images on a larger scale. When we integrate a function (which could be a color gradient over a fully filled…
Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#64Earlier quoted context omitted.
Why do conflation artifacts always exist with a box filter? AFAIK conflation artifacts are a product of the compositing process, not the filtering process. If you have two non-overlapping shapes of the same color covering the plane and use a box filter on the first shape to sample a pixel on the boundary, and then use the same box filter on the second shape, and then composit them with alpha blending, you get a confl…
It’s because sampling artifacts never disappear with Box. The reason is the high frequency aliasing is introduced by the filtering. It’s because the Box itself has infinite frequency response that you cannot eliminate the artifacts, it’s not possible. This is why all other, better filters fade their weight smoothly to zero at the support boundary. You can see this with a single sharp edge, it doesn’t need to involve…
Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#65Earlier quoted context omitted.
It’s because sampling artifacts never disappear with Box. The reason is the high frequency aliasing is introduced by the filtering. It’s because the Box itself has infinite frequency response that you cannot eliminate the artifacts, it’s not possible. This is why all other, better filters fade their weight smoothly to zero at the support boundary. You can see this with a single sharp edge, it doesn’t need to involve…
These are sampling artifacts, but I believe yorbwa is correct in distinguishing these from conflation artifacts, as defined in Kilgard & Bolz. I think of the latter as compositing not commuting exactly with antialiasing (sampling). You only get conflation artifacts when compositing multiple shapes (or rendering a single shape using analytical area when the winding number is not everywhere 0 or 1), while you definitel…
Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#66Earlier quoted context omitted.
That isn’t true. Again, please look more closely at the first example in the article, and take the time to understand it. It demonstrates there’s a better method than what you’re suggesting, proving that clipping to pixels and summing the area is not the best visual quality you can get.
As pointed out by Raphlinus, the moire pattern in the Siemens star isn't such a significant quality indicator for the type of content usually encountered in 2D vector graphics. With the analytical coverage calculation you can have perfect font/text rendering, perfect thin lines/shapes and, by solving all the areas at once, no conflating artifacts.
Can we make a magical adaptive filter which resembles box filter for half-planes, a tent filter for thin lines, Mitchell-Netravali or oblique projection for natural images, and Gaussian when filtering images for which high frequency detail is not important? Perhaps, but that feels like advanced research, and also computationally expensive. I don't think you can claim "perfect" without backing it up with human factors data really demonstrating that the filtered images are optimum with respect to perceived quality.
Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#67The opening statement makes it out that this exact calculation is supposed to be superior to multisampling, but the opposite is the case. Computing the exact mathematical coverage of a single polygon against a background is useless for animations if you can't seamlessly stitch multiple polygons together. And that's why GPUs use multisampling: Each sample is an exact mathematical point that's covered by either polygon…
You might be making some incorrect assumptions about what this article is describing. It’s not limited to a single polygon against a background. Analytic integration is always superior to multisampling, assuming the same choice of filter, and as long as the analytic integration is correct. Your comment is making an assumption that the analytic integration is incorrect in the presence of multiple polygons. This isn’t…
Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#68Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#69I'm surprised that the article doesn't mention Fourier transforms and neither do any of the comments. All the talk about aliasing and different filters makes a whole lot more sense if you take a look at the frequency domain. (Unfortunately I don't have time to elaborate here. But Fourier transforms are so useful in many ways that I encourage people to learn more.)
Re: Exact Polygonal Filtering: Using Green's Theorem and Clipping for Anti-Aliasing
#70I love to see more work in this space. It's clear that GPU compute is the future of 2D rendering, and we need to explore a bunch of different approaches to find the best one. I especially appreciate the focus on rendering quality; the author is absolutely correct that the current state of Vello has conflation artifacts and does not do antialiasing in the correct (linear) colorspace. We do have a plan for conflation f…
The analytic approach to occlusion definitely does seem like a "humbling parallelism" type of problem on the GPU. My curiosity is leading me to explore it, and it may be reasonable if I find alternatives to large GPU sorts (although I understand you've done some work on that recently). I think the Vello approach is very likely the superior option for the best general quality/performance tradeoff.
If I were going to take it on, I'd start with BVH construction - the H-PLOC paper at the latest HPG [1] looks promising - then traverse down the hierarchy until you get very small number of path segments so you can pairwise compare them. Obviously any time there is an intersection you need at least the two segments.
This seems hard to me, humbling even. I mean, overlap removal is hard enough on the CPU, especially because it's so sensitive to numerical robustness, and doubly so for curves. But I think you'll learn something for trying!
[﹡] https://news.ycombinator.com/item?id=41105102 but it didn't make the front page; I'm holding back promoting it further pending writing a companion blog post.