4 ms·
Fantastic article, exactly my kinda thing :) One significant limitation here is that the polygon needs to have constant colour, unfortunately.
by pixelpoet 2y ago
Fantastic article, exactly my kinda thing :)
One significant limitation here is that the polygon needs to have constant colour, unfortunately.
- Etherlord87 2y agoBut the blurring example has a gradient on the star?
- muyyatin2 2y agoAhh 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.
- pixelpoet 2y agoIf 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/ArvoThesis.pdf 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_Antialiasing_with_Prism_Splines https://www.researchgate.net/publication/2524514_Analytic_An...
- dahart 2y agoArvo’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.
- pixelpoet 2y agoYup, 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.
- WithinReason 2y agoIf 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
- taylorius 2y agoAnything is constant colour if you dice it up into small enough pieces! :-)
- bee_rider 2y agoIs 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.
- taylorius 2y agoThey 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.
- persnickety 2y agoThe Mandelbrot set disagrees!