<sk-cloner-points-source>

← prev index next →

Reuses another cloner's placements as its own points — the way to stamp several different templates at one shared set of positions without recomputing them.

Remarks

This is the shared-positions member of the points-source family (see ShaderFunctionPointsSource): a points-source defines the set of positions at which a sk-cloner places copies of its content, so it lives as a child of a <sk-cloner> and the cloner's other child is the template cloned at each point. Instead of a formula or a mesh, this source takes its positions from a source cloner's already-computed transforms — so the consuming cloner places exactly as many instances as the source produced (its count is the source's count, not a product of the two). Its value is reuse: several consuming cloners can reference the same source and share that one transform buffer, so drawing K different templates at N shared positions costs N+K point sets of memory, not K independently-recomputed copies of N.

This is distinct from multiplicative nesting — placing a whole cloned group at every point of an outer cloner for an N×M "grid of grids". That is a separate mechanism: DOM-nest one <sk-cloner> inside another, each with its OWN points-source, and their counts multiply (see sk-cloner).

Key attributes. cloner references (by #id) the source cloner whose output supplies the points. That source cloner is typically declared with mode="object" — it just produces the set of positions and carries no visible template of its own — while each consuming cloner holds the template that gets stamped at those positions.

Related. For points that come from a mesh see sk-mesh-vertex-points-source and sk-mesh-surface-points-source; from an explicit buffer see sk-buffer-points-source; from the GPU see sk-compute-buffer-points-source and sk-custom-wgsl-points-source. For the built-in procedural shapes that commonly drive the source cloner, see sk-grid-points-source and sk-sphere-points-source. Its host — and the source it references — are both a sk-cloner.

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.
clonerrequiredanimatable <id-ref> Optional parent Cloner instance whose output provides points. reference by id