/** * GPU resources for one point cloud asset. * * Phase 1+ supports multi-chunk assets: streaming sources push chunks * into a node one at a time, each becoming its own GPU vertex buffer. * Each chunk is drawn with one draw call sharing the asset's bind group. */ import type { PointCloudAsset } from '@ifc-lite/geometry'; import type { PointRenderPipeline } from './point-pipeline.js'; export interface PointCloudGpuChunk { vertexBuffer: GPUBuffer; /** * Per-point signed-distance buffer. Always allocated alongside the * vertex buffer (4 bytes per point) so the compute pass and splat * pipeline can both bind it without a "deviation present?" branch. * Initialised to zeros — `Renderer.computeDeviations` overwrites. */ deviationBuffer: GPUBuffer; pointCount: number; bbox: { min: [number, number, number]; max: [number, number, number]; }; } /** Inputs to a single chunk upload. */ export interface PointCloudChunkInput { positions: Float32Array; /** RGB in 0..1; undefined → defaults to gray. */ colors?: Float32Array; /** Per-point u8 LAS classification; undefined → 0. */ classifications?: Uint8Array; /** Per-point u16 intensity; undefined → 0. */ intensities?: Uint16Array; pointCount: number; bbox: { min: [number, number, number]; max: [number, number, number]; }; } export interface PointCloudNodeMeta { expressId: number; ifcType?: string; modelIndex?: number; } export interface PointCloudNode { meta: PointCloudNodeMeta; uniformBuffer: GPUBuffer; bindGroup: GPUBindGroup; chunks: PointCloudGpuChunk[]; bounds: { min: [number, number, number]; max: [number, number, number]; }; pointCount: number; } /** Build an empty node — chunks are appended via `appendChunkToNode`. */ export declare function createNode(device: GPUDevice, pipeline: PointRenderPipeline, meta: PointCloudNodeMeta): PointCloudNode; /** * Append a chunk's points to a node as one or more GPU vertex buffers. * * A single GPU buffer can't exceed `maxBufferSize` (typically 256 MiB), and * because this vertex buffer is also bound as STORAGE for the deviation * compute, `maxStorageBufferBindingSize` (often 128 MiB) applies too. At * 24 B/point that caps a buffer at ~5–11 M points — so a large chunk (e.g. a * whole-file decode that doesn't sub-chunk, or a big inline cloud) is split * into sub-buffers that each fit, instead of failing with * "Buffer size N is greater than the maximum buffer size". The draw and * deviation passes already iterate `node.chunks`, so the split is transparent. */ export declare function appendChunkToNode(device: GPUDevice, node: PointCloudNode, chunk: PointCloudChunkInput): void; /** One-shot upload — produces a node with a single GPU chunk. */ export declare function uploadAssetToGpu(device: GPUDevice, pipeline: PointRenderPipeline, asset: PointCloudAsset): PointCloudNode; export declare function destroyNode(node: PointCloudNode): void; //# sourceMappingURL=point-cloud-node.d.ts.map