/** * @holoscript/core GPU Culling System * * GPU-driven frustum and occlusion culling with compute shaders. * Implements Hi-Z hierarchical occlusion culling and indirect draw buffer generation. */ export interface GPUCullingOptions { /** Enable frustum culling (default: true) */ enableFrustumCulling: boolean; /** Enable occlusion culling (default: true) */ enableOcclusionCulling: boolean; /** Hi-Z mipmap levels (default: 8) */ hiZLevels: number; /** Workgroup size for compute shader (default: 64) */ workgroupSize: number; /** Enable GPU LOD selection (default: true) */ enableGPULODSelection: boolean; /** Debug mode (default: false) */ debug: boolean; } export declare const DEFAULT_GPU_CULLING_OPTIONS: GPUCullingOptions; export interface CullingStats { /** Total objects processed */ totalObjects: number; /** Objects visible after culling */ visibleObjects: number; /** Objects culled by frustum */ frustumCulled: number; /** Objects culled by occlusion */ occlusionCulled: number; /** GPU culling time (ms) */ cullingTimeMs: number; /** Hi-Z generation time (ms) */ hiZTimeMs: number; } export interface ObjectInstance { /** World position */ position: [number, number, number]; /** Bounding sphere radius */ radius: number; /** Current LOD level */ lodLevel: number; /** LOD distances (up to 4 levels) */ lodDistances: [number, number, number, number]; /** Object ID for tracking */ objectId: number; } export interface CullingResult { /** Indices of visible objects */ visibleIndices: Uint32Array; /** Selected LOD levels for visible objects */ selectedLODs: Uint32Array; /** Count of visible objects */ visibleCount: number; /** Stats from this culling pass */ stats: CullingStats; } export declare class GPUCullingSystem { private options; private device; private frustumPipeline; private occlusionPipeline; private hiZPipeline; private initialized; private stats; private cameraBuffer; private objectBuffer; private visibleIndicesBuffer; private selectedLODsBuffer; private visibleCountBuffer; private readbackBuffer; private hiZTextures; private depthTexture; constructor(options?: Partial); /** * Initialize GPU resources */ initialize(device: GPUDevice): Promise; /** * Create frustum culling pipeline */ private createFrustumPipeline; /** * Create occlusion culling pipeline */ private createOcclusionPipeline; /** * Create Hi-Z mipmap generation pipeline */ private createHiZPipeline; /** * Update object data buffer */ updateObjectBuffer(objects: ObjectInstance[]): void; /** * Update camera uniform buffer */ updateCameraBuffer(viewProjMatrix: Float32Array, cameraPos: [number, number, number], frustumPlanes: Float32Array): void; /** * Perform GPU culling */ cull(objects: ObjectInstance[], viewProjMatrix: Float32Array, cameraPos: [number, number, number], frustumPlanes: Float32Array, depthTexture?: GPUTexture): Promise; /** * Execute frustum culling compute pass */ private executeFrustumCulling; /** * Execute occlusion culling compute pass */ private executeOcclusionCulling; /** * Generate Hi-Z mipmap chain */ private generateHiZ; /** * Create Hi-Z texture chain */ private createHiZTextures; /** * Create output buffers */ private createOutputBuffers; /** * Read back culling results from GPU */ private readbackResults; /** * Create result with no culling (all visible) */ private createNocullingResult; private createStats; getStats(): CullingStats; isInitialized(): boolean; destroy(): void; } /** * Create GPU culling system with default options */ export declare function createGPUCullingSystem(options?: Partial): GPUCullingSystem; /** * Bridge: Convert SpatialPartitionResult anchors (from core's SpatialPartitionPass) * into ObjectInstance[] for GPU culling. * * SpatialAnchor.position is [x, y, z] (same tuple shape as ObjectInstance.position). * SpatialAnchor.scale maps to ObjectInstance.radius (both represent the effective * size of the anchor's Gaussian cloud). SpatialAnchor.lodLevel maps directly. * SpatialAnchor.importance is used as a visibility boost: anchors above a threshold * are never culled (treated as infinite radius for the frustum test). * * @param anchors - Anchor array from SpatialPartitionResult.anchors * @param defaultDistances - LOD distance thresholds [d0, d1, d2, d3]. Defaults to * [50, 150, 400, 1200] matching OctreeLODSystem's power-law thresholds. * @returns ObjectInstance[] ready for GPUCullingSystem.cull() */ export declare function spatialAnchorsToObjectInstances(anchors: Array<{ position: [number, number, number]; scale: number; lodLevel: number; importance: number; id?: string; }>, defaultDistances?: [number, number, number, number]): ObjectInstance[]; /** * Calculate frustum planes from view-projection matrix */ export declare function extractFrustumPlanes(viewProj: Float32Array): Float32Array; //# sourceMappingURL=GPUCullingSystem.d.ts.map