/** * RenderGraph.ts * * Declarative render graph: defines passes (shadow, depth-prepass, G-buffer, * lighting, post-process), their texture inputs/outputs, and execution order. * The graph is topologically sorted before execution. * * @module render */ import type { EngineSystem } from '../SpatialEngine'; export type TextureFormat = 'rgba8unorm' | 'rgba16float' | 'depth24plus' | 'depth32float' | 'r32float' | 'rg16float'; export interface RenderTarget { id: string; width: number; height: number; format: TextureFormat; mipLevels?: number; } export interface RenderPassDescriptor { /** Unique pass name. */ id: string; /** Textures this pass reads from. */ inputs: string[]; /** Textures this pass writes to. */ outputs: string[]; /** Clear color (null = don't clear). */ clearColor?: { r: number; g: number; b: number; a: number; } | null; /** Whether this pass writes to the backbuffer. */ presentToScreen?: boolean; /** Execute callback — receives pass context. */ execute: (ctx: PassContext) => void; /** Priority hint for ordering (lower = earlier when no dependency). */ priority?: number; /** Tags for filtering (e.g., 'shadow', 'transparent', 'post'). */ tags?: string[]; /** Is this pass enabled? */ enabled?: boolean; } export interface PassContext { passId: string; inputs: Map; outputs: Map; frameNumber: number; deltaTime: number; width: number; height: number; } export interface GraphStats { passCount: number; targetCount: number; executionOrderMs: number; passTimings: Map; } export declare class RenderGraph implements EngineSystem { readonly name = "RenderGraph"; readonly priority = 900; private passes; private targets; private executionOrder; private dirty; private frameNumber; private width; private height; private stats; setResolution(width: number, height: number): void; addTarget(target: RenderTarget): this; removeTarget(id: string): boolean; getTarget(id: string): RenderTarget | undefined; addPass(pass: RenderPassDescriptor): this; removePass(id: string): boolean; enablePass(id: string, enabled: boolean): void; getPass(id: string): RenderPassDescriptor | undefined; getPassesByTag(tag: string): RenderPassDescriptor[]; private compile; lateUpdate(dt: number): void; getExecutionOrder(): string[]; getStats(): GraphStats; /** * Set up a standard forward+ rendering pipeline: * shadow → depth-prepass → main-color → post-process → present */ setupForwardPipeline(): this; destroy(): void; } //# sourceMappingURL=RenderGraph.d.ts.map