<sk-compute-buffer-spline-source>

← prev index next →

Draws a spline whose polyline is computed on the GPU by a compute node — the way to render a curve generated by a simulation or parallel kernel (a particle trail, an evolving wave, any per-vertex position array a compute pass writes).

Remarks

This is the GPU-fed member of the spline-source family: a spline-source supplies the curve geometry for a AbstractSpline, so it lives as the single geometry child of a sk-spline. It owns no geometry of its own and allocates no buffers — it names a sk-compute-node producer and reads that node's output polyline, which the renderer binds zero-copy; CPU-side queries (pointAt, bounds, cloner matrices) come from the inherited readback path and are null until the first readback completes.

Key attributes. compute-node is a #id reference to the sk-compute-node that produces the polyline — the direct, common wire-in. compute-property-key selects which of that node's outputs to read (default output.0). is-closed declares whether the generated polyline forms a closed loop (last vertex joins the first). Like every spline-source it also carries the family's distribution / distribution-count controls: a spline-source is itself a points-source, so a sk-cloner given one places clones along the curve, and these controls choose how the curve is sampled into those positions.

Related. It is one input modality of the spline-source family alongside sk-svg-spline-source, sk-points-spline-source, sk-trail-spline-source, sk-morph-spline-source, and its GPU sibling sk-custom-wgsl-spline-source (which generates the polyline from inline WGSL instead of a separate producer). Its producer is a sk-compute-node; its host is a sk-spline, whose curve then draws with a stroke paint or carries an sk-align-to-spline-constraint.

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
is-closedanimatable <boolean> false Whether the spline forms a closed loop (last vertex joins the first).
compute-nodeanimatable <id-ref> The directly referenced compute node, or null when the source is reference by id
compute-property-key <property-name> "output.0" The computed-property key read from the referenced compute node
distributionanimatable <spline-distribution> ("control-points" | "tessellated" | "arc-length-spaced") How clone points are placed along the spline — at the control points, at
distribution-count <number> The number of evenly spaced points to place when the distribution is