/** * WebGPUBackendRenderer.ts — ECSWorld → WebGPURenderer primary scene backend. * * Task: task_1780691124860_2h3s (D.083, native-engine, P1) * * Wires the THREE-free path: * engine/vm ECSWorld → DrawSpec[] (pure data, no GPU) * → IDrawCall[] (GPU resources, requires GPUDevice) * → WebGPURenderer.beginFrame / submitDrawCalls / endFrame * * This is a BaseRuntimeRenderer implementation so RuntimeRenderer backend * selection can default to it, demoting ThreeJSRenderer to bridge-only. * * DESIGN NOTES (pre-mortem outcomes, preserved here): * - IDrawCall is GPU-resource-bound: the connector must hold a GPUDevice. * We lazy-init via WebGPURenderer.initialize() on the first render() call. * - Pipeline registration: we use a single unlit pipeline per geometry kind. * PBR / advanced material pipelines are opt-in via the material's pipelineId. * - ThreeJSRenderer is NOT touched here; it remains importable for bridge use. * The DEFAULT_BACKEND constant controls which is instantiated by RuntimeRegistry. */ import { BaseRuntimeRenderer, type RenderableObject, type RenderableLight, type RenderableCamera, type ParticleSystem, type PostProcessingEffect, type RendererConfig, type RendererStatistics } from './RuntimeRenderer'; import type { HoloComposition } from '@holoscript/core'; import { ECSWorld } from '../vm/executor'; export declare class WebGPUBackendRenderer extends BaseRuntimeRenderer { private readonly webgpu; private world; private initialized; private rafId; private lastTime; private readonly PIPELINE_ID; private readonly PARTICLE_PIPELINE_ID; private meshCache; private materialCache; private particleResources; private particleUniformBuffer; private particleUniformBindGroup; private postProcessingEffects; private cameraPos; private cameraTarget; constructor(config?: RendererConfig); attachWorld(world: ECSWorld): void; initialize(composition: HoloComposition, config?: RendererConfig): void; start(): void; stop(): void; update(_deltaTime: number): void; render(): void; initializeGPU(canvas: HTMLCanvasElement): Promise; private registerUnlitPipeline; private registerParticlePipeline; private buildDrawCalls; private getOrCreateMesh; private getOrCreateMaterial; private updateMaterialBuffer; private buildRenderMaterial; addObject(object: RenderableObject): void; removeObject(objectId: string): void; updateObjectTransform(objectId: string, transform: { position?: [number, number, number]; rotation?: [number, number, number]; scale?: [number, number, number]; }): void; addParticleSystem(system: ParticleSystem): void; updateParticleSystem(id: string, positions: Float32Array, colors?: Float32Array): void; removeParticleSystem(id: string): void; addLight(light: RenderableLight): void; updateCamera(camera: RenderableCamera): void; enablePostProcessing(effect: PostProcessingEffect): void; getStatistics(): RendererStatistics; resize(width: number, height: number): void; dispose(): void; private clearGPUCaches; private getReadyDevice; private getPipeline; private hydrateParticleResources; private createOrReplaceParticleResources; private writeParticleUniforms; private submitParticleSystems; private clearParticleResources; private hydratePostProcessingResources; private ensurePostProcessingResources; private destroyPostProcessingEffect; private clearPostProcessingResources; } /** * DEFAULT_BACKEND controls which RuntimeRenderer is instantiated when no * backend is explicitly requested. 'webgpu' = WebGPUBackendRenderer (native, * Three-free); 'threejs' = ThreeJSRenderer (bridge, legacy). * * Demoting ThreeJSRenderer: when this is 'webgpu', grep for `ThreeJSRenderer` * imports in the primary scene path should find 0 results outside of * bridge/compat modules. */ export declare const DEFAULT_BACKEND: 'webgpu' | 'threejs'; //# sourceMappingURL=WebGPUBackendRenderer.d.ts.map