News for hackers. Stuff that matters.
Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by pixelpoet on Thursday August 15, 2024 @02:50AM (#41253656)
Fantastic article, exactly my kinda thing :)

One significant limitation here is that the polygon needs to have constant colour, unfortunately.

Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by muyyatin2 on Thursday August 15, 2024 @03:47AM (#41253897)
Ahh yes, for exact filtering it does need to be constant colour. I'm looking into seeing whether it can be done for gradients. However in practice, it works quite well visually to compute the "average color of the polygon" for each piecewise section, and blend those together.
Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by pixelpoet on Thursday August 15, 2024 @07:43AM (#41254883)
If you look at old papers by James Arvo, he has done analytic illumination from linearly varying lights, maybe this is helpful. Here for example his thesis: https://www.cs.cornell.edu/courses/cs667/2005sp/readings/Arv...

There's also this work on analytic antialiasing by Michael Mccool: https://www.researchgate.net/publication/2524514_Analytic_An...

Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by dahart on Thursday August 15, 2024 @01:57PM (#41258693)
Arvo’s work is also using Green’s theorem, in much the same way this article is. Integrating the phong-exponent light reflections is a little bit insane though (and btw I’ve seen Arvo’s code for it.)

The problem you run into with non-constant polygon colors is that you’d have to integrate the product of two different functions here - the polygon color and the filter function. For anything real-world, this is almost certainly going to result in an expression that is not analytically integrable.

Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by pixelpoet on Thursday August 15, 2024 @02:20PM (#41258920)
Yup, I've tried many years ago to follow this work (special cases for even and odd exponents!), with a mix of analytic and numerical integration. IMO linear/tent filter is sufficient. Also more recently there's the Linearly Transformed Cosine stuff, which is most of what people usually want in realtime graphics.

Ideally you also want motion blur and probably some other effects, so IMO it just makes sense to use a 2D BVH and high efficiency Monte Carlo importance sampling methods.

Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by WithinReason on Thursday August 15, 2024 @05:09AM (#41254234)
If it's textured, an anisotropic filter is a good approximation of the constant colour over the pixel area. The main source of aliasing is the polygon edge, not the texture
Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by taylorius on Thursday August 15, 2024 @05:19AM (#41254270)
Anything is constant colour if you dice it up into small enough pieces! :-)
Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by bee_rider on Thursday August 15, 2024 @10:12AM (#41256309)
Is that necessarily the case for vector graphics? I actually don’t know how they define their colors. It seems intuitive enough to define a gradient using a function rather than discrete series, but I have no idea if anyone actually does that.
Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by taylorius on Friday August 16, 2024 @08:38AM (#41265841)
They absolutely do define gradients via functions - but the point it, the screen only has a finite number of pixels. As I understood it, pixels is what this technique uses as it's dicing primitive. Pixel sized rectangles cut out of the polygon.

Pixar's Renderman used to use a (slightly) related technique. This was along time ago, and I have no idea if they still do things this way - but they would subdivide patches until each primitive was smaller than a pixel.

Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by persnickety on Thursday August 15, 2024 @10:30AM (#41256583)
The Mandelbrot set disagrees!
Re:Exact Polygonal Filtering: Using Green's Theorem and Clip... by Etherlord87 on Thursday August 15, 2024 @05:20AM (#41254275)
But the blurring example has a gradient on the star?