<sk-surface-paint>

← prev index next →

Fills a node's triangle faces with a material — the ordinary way to make a mesh look solid, giving its surface a color and shading rather than just an outline.

Remarks

This is the surface member of the Paint family: like every paint it applies a material to one part of a node's geometry; here that part is the filled triangle surface, so the material's base color, tonemap, and lighting response are what you see across the object's faces.

Key attributes. material (inherited from Paint) references the material to render by id. cull-mode chooses which triangle faces to draw: back draws only front faces — right for a closed solid; front draws only back faces; and none draws both sides, which is what open or flat geometry (a disc, a plane, a one-sided ribbon) needs so it does not vanish when viewed from behind. Left unset, it follows the mesh's own default — back for most solids, but none for open shapes like discs and planes. selection binds the paint to a subset of the mesh's faces instead of the whole surface: it takes a #id reference to a sk-selection authored on the same mesh, so several paints on one mesh can fill disjoint face sets — a cube rendered as a die is six selection-bound paints on one cube. Left unset, the paint fills the whole surface (the original behavior); an unresolved selection draws nothing rather than silently filling the whole mesh.

Related. A sk-selection names the faces this paint targets. Its sibling paints cover the other parts of the geometry: sk-edge-paint (wireframe edges) and sk-stroke-paint (spline strokes); several paints can stack on one node in document order. The material it applies is a sk-plain-material.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
id <id> The element's unique identifier — the standard HTML global id attribute.
materialanimatable <id-ref> Gets the material this paint applies. reference by id
selection <selection-token> A single-token reference to a Selection restricting which faces this reference by id
cull-modeanimatable <cull-mode> ("front" | "back" | "none") "back" Face culling mode for triangle rendering. Left unset, the paint inherits the

Children

Optional spatial-field children (gradient/noise/random fields) modulating per-pixel surface coverage.