Mindtraveller Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
Experienced Contributor
Thank you for the replies. The problem is clear now.
Currently I see the only solution, and I'm not really shure you want it.
Anyway. We could use temporary surface which stores color + alpha for a sequence of operations. On writing a pixel, it's color is calculated in usual way, but alpha is added to the current alpha value. E.g. we will have alpha = 256 in previous Mirek's example. Rendering this temporary surface to actual image will give solid black color which is absolutely right result.
This could look like this:
UPDATE: OK, here is quick and dirty "back-end" solution. Let's imagine we draw polygons in scaled coordinates:
painter.Scale(scale);
To avoid polygon stitching you may simply move polygon adjacent vertices with 0.5/scale towards neighbouring polygon, i.e.
painter.Move(x[i]+.5/scale,y[i]);
It moves polygon vertex to the next physical pixel if it's position is actually between pixels.
This technique seems like eliminating visual artifacts with U++ rendering of adjacent polygons.