composition3d
Draws composition in 3D, like composition draws it in 2D, but as triangles: fills are tessellated with openrndr-ktessellation, and strokes are made of the outlines of their segments, joins and caps in the plane of the composition, which are tessellated together so that a translucent stroke is drawn once where it overlaps itself. The composition is in the xy-plane of the model of the drawer, so it can be placed, turned and seen in perspective like any other geometry, with depth testing. Its layers are drawn in their order, without fighting over depth; when the drawer writes depth, the composition is drawn a second time to the depth buffer only.
Fills and strokes are drawn in their colors and opacities, gradients and patterns in object units, with the line joins, caps, miter limits and dash patterns of the strokes. A stroke that does not scale is drawn as a line of its width on the screen, also with its joins and caps. Text, also text that wraps and text along a contour, is drawn as the shapes of its glyphs, with the colors, gradients and patterns of their fills and strokes; images are drawn as composition draws them. Clip paths and masks are rendered with the transforms of the composition into textures of the size of the target, by which the alpha of what is drawn in them is multiplied, so they clip in perspective too; a mask applies to every shape in it, not to the group of them as a whole. A node with filters or a blend mode is drawn flat, as composition draws it, on a layer of the resolution it has on the screen, which is drawn in the plane and blended with what is drawn under it; the layer covers the part of the node on the screen and the margin its filters reach into, a node that is not on the screen is not drawn. A composition with blend modes is drawn on a layer of its own, so that it blends with itself only, like in SVG. Markers are drawn at the vertices of their shapes, their content in 3D too. Group opacity is applied to the shapes in the group.
The tessellations are kept with the shapes and made again when a shape or its stroke changes.
Parameters
the largest distance between the curves and the triangles, in the units of the composition