Skip to content

PointCloud.setPointsBuffer

Summary

PointCloud.setPointsBuffer updates points buffer state on this PointCloud and marks dependent GPU data for refresh.

Syntax

PointCloud.setPointsBuffer(buffer: GPUBuffer, pointCount: number): void
pointCloud.setPointsBuffer(buffer, pointCount);

Parameters

Name Type Required Description
buffer GPUBuffer Yes GPUBuffer handle used as an external data source.
pointCount number Yes Number of points represented by the supplied data source.

Returns

void - No return value. The call applies side effects to runtime state and/or GPU resources.

Type Details

// No additional descriptor expansion is required for this signature.

Example

const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);

const pointCloud = wgpu.createPointCloud({ data: new Float32Array([0, 0, 0, 0.1, 1, 0, 0, 0.8]), scaleTransform: { mode: "linear", domainMin: 0, domainMax: 1 } });
const buffer = wgpu.gpu.device.createBuffer({ size: 64, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST });
const pointCount = 2;
pointCloud.setPointsBuffer(buffer, pointCount);
console.log("updated");

See Also