Hacker News new | past | comments | ask | show | jobs | submit login

Fantastic article, exactly my kinda thing :)

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




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


Anything is constant colour if you dice it up into small enough pieces! :-)


The Mandelbrot set disagrees!


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.


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.


But the blurring example has a gradient on the star?


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.


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...


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.


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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: