ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

render: Self-overlapping semi-transparent strokes are rendered incorrectly

Open torokati44 opened this issue 3 years ago • 0 comments

One great example of this is https://z0r.de/2245, where the changing colored overlay is made up of a really thickly stroked scribble, and it should appear as uniform in opacity and color. It does not.

Software rasterizers might have an easy time to skip any pixel when drawing the stroke that they already touched in this operation. Otherwise, the usual solution is to turn the stroke outline into a fill path, then fill it with a non-zero fill rule. This path conversion is not (yet?) provided by lyon.

It could also be possible to put the triangles outputted by the stroke tessellator through the fill tessellator again - as a path made up of distinct 3 sided polygons. This way any overlaps will disappear. However, this is likely to turn out to be massively inefficient.

It might also be possible to rasterize the overlapping triangles with some sort of depth or stencil buffer trick to discard the repeated paints at the overlaps.

torokati44 avatar Aug 03 '22 00:08 torokati44