ComputeBufferPointsSource

← prev index next →

Places clones at per-point transforms a GPU compute pass writes into a buffer — the way to drive a cloner from positions computed on the GPU each frame (a physics step, a flocking simulation, a compute-shader layout).

Remarks

This is a data-driven 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. Unlike the procedural sources — which generate their points from a formula — this one takes its placements from a sk-compute-node: the cloner binds the producer's GPU buffer slice directly (zero-copy, nothing read back to the CPU), so the layout can be regenerated on the GPU every frame at no transfer cost.

Key attributes. compute-node references (by #id) the sk-compute-node whose output supplies the placements; that node must be declared with output-kind="point-matrices" so it emits PointData records (one local matrix per point). compute-property-key selects which output to read when a node exposes several — it defaults to output.0, so a single-output producer needs no key. The source stays inert (zero points) until the referenced producer is resolved and GPU-ready.

Related. For placements written as a per-index function instead of a compute pass, see sk-custom-wgsl-points-source; both pair naturally with a sk-compute-node. For object/data-driven placements see sk-mesh-vertex-points-source, sk-mesh-surface-points-source, sk-buffer-points-source, and sk-cloner-points-source; for built-in procedural shapes see sk-grid-points-source and sk-sphere-points-source. Its host is always a sk-cloner.

Constructor

constructor(config?: { computeNode?: AbstractComputeNode; computePropertyKey?: string })

Properties

Config Properties

PropertyTypeDefaultDescriptionDeclared by
computeNodeanimatable AbstractComputeNode The directly referenced compute node, or null. ComputeBufferPointsSource
computePropertyKey string "output.0" The computed-property key read from the referenced compute node ComputeBufferPointsSource

Other Properties

PropertyTypeDefaultDescriptionDeclared by
pointCountread-only number 0 Point count from the effective handle; 0 while unresolved (inert). ComputeBufferPointsSource
localMatricesread-only Float32Array<ArrayBufferLike> | null Always null: the matrices live only on the GPU (the cloner binds ComputeBufferPointsSource
gpuData GPUPointsData | null The effective GPUPointsData handle: the direct-reference ComputeBufferPointsSource
sceneread-only any Gets the Scene this animatable belongs to, if any. SkenraAnimatable
animationsread-only SkenraAnimation[] Public getter for the animations affecting this target. SkenraAnimatable

Methods

MethodDescriptionDeclared by
getBoundsInSpace(_fullTransform: Float32Array): { minX: number; maxX: number; minY: number; maxY: number; minZ: number; maxZ: number; } | null Always null: matrices are GPU-only (no CPU positions to bound), ComputeBufferPointsSource
animate(firstArg: TypedKeyframe<this>[] | TypedPropertyIndexedKeyframes<this> | Record<string, any> | globalThis.Keyframe[] | globalThis.PropertyIndexedKeyframes | null, secondArg?: number | KeyframeAnimationOptions | globalThis.KeyframeAnimationOptions): SkenraAnimation & Animation Creates a new SkenraAnimation for this target per Web Animations API. SkenraAnimatable
removeAnimation(animation: SkenraAnimation): boolean Removes a specific animation from this object. SkenraAnimatable
constrain(type: K, config: ConstraintConfigMap[K]): ConstraintReturnMap[K] Creates a constraint on this Animatable using a fluent API. SkenraAnimatable