On Tue, Sep 23, 2014 at 10:42:26AM +0200, Jasper van de Gronde wrote:
On 09/22/2014 10:55 PM, Nathan Hurst wrote:
Exactly Niko, and this problem is probably only solved by super- sampling in some form.
There are other options for /mitigating/ this particular problem. For example, you could do some post-processing to detect the (rough) local orientation, or whether there are any totally transparent pixels in the neighbourhood, to guide the blending. Or you could try keeping track of a little bit more information than just the coverage, like the barycenter of the coverage (and/or even higher moments), and incorporate that information in the blending operation.
I suspect that will end up being a lot more work than just super sampling. Remember, it has to be done per pixel. Adding an edge pixel bitmap proof of concept to the existing render sounds like an afternoon project for someone who has a current build working and knows where to look. Allocate a bitmap (I think we render 256 square tiles don't we, so we just need another 8k buffer, it would even fit in cache), modify the edge blending code to just set the bit, clear all opaque internal pixels. Then we rerender those pixels again with a higher resolution.
An actual (although fairly impractical) solution would essentially use boolean operations on the rendered shapes to split shapes into parts that fully overlap and parts that do not overlap at all, and then use the appropriate blend modes. This should give perfect results, but would require extremely fast and accurate boolean operations, and would massively complicate rendering.
Until we have robust and fast boolops, this isn't really an option :( And I doubt boolops will be competitive with a pixel basd approach.
The easiest way of getting this type of stuff working would probably indeed be to start supporting GPU-based rendering. Although I'm not sure whether the specific mode suggested by you (which indeed makes sense) already exists, there are a lot of anti aliasing modes available already that we could basically use out of the box.
GPU rendering is definitely a good idea, but much more work than the software solution.
njh