|

Coverage layer

On this page, we study what a translucent stroke does before it reaches the canvas.

A translucent stroke whose geometry covers a pixel more than once (a bend folding the ribbon over itself) would composite that pixel more than once and darken into creases. Marks that opt in render alone into an offscreen buffer with MAX blending first, so any number of coverings leaves the strongest single one, and the buffer then composites into the canvas exactly once. There are no thresholds, so there is nothing for a seam to form along.

The buffer, live

open full size ↗

Draw on the left half with a broad charcoal; the right half shows the coverage buffer while you draw, its coverage drawn as brightness. Curl the stroke tightly over itself and watch both sides: the buffer holds the piece alone at uniform strength, its folds already reduced to single coverage, and the canvas receives exactly that.

Details

What the buffer holds: The piece currently being drawn, alone. A turn sharper than a threshold splits the drawn line, so after a sharp corner the buffer shows only the newest piece; finished pieces composite out of it and live on the canvas.

Why MAX: With MAX blending, a pixel covered twice by the same mark keeps the stronger covering instead of the sum, so the result of drawing a region twice equals drawing it once. Separate pieces and separate strokes still layer, because each composites from its own pass.

The mechanism is `singleCoverage` on the shader stroke base, documented on Renderers.