export type GPUTextureFormatType = 'bgra8unorm' | 'rgba8unorm' | 'rgba16float' | 'rgba32float' | 'depth24plus' | 'depth32float' | 'depth24plus-stencil8';
export type GPUBlendModeType = 'opaque' | 'alpha-blend' | 'additive' | 'multiply' | 'premultiplied';
export type ToneMappingMode = 'none' | 'reinhard' | 'aces' | 'filmic' | 'uncharted2';
export type MaterialType = 'pbr' | 'unlit' | 'sprite' | 'particle' | 'custom';
export type RenderPassType = 'depth-prepass' | 'shadow' | 'color' | 'transparent' | 'post-process' | 'ui-overlay';
export type LightCategory = 'directional' | 'point' | 'spot' | 'area';
export type PostEffectType = 'bloom' | 'fxaa' | 'taa' | 'ssao' | 'motion-blur' | 'chromatic-aberration' | 'vignette' | 'color-grading' | 'dof' | 'film-grain';
export interface VertexAttribute {
    name: string;
    format: string;
    offset: number;
    shaderLocation: number;
}
export interface VertexBufferLayout {
    arrayStride: number;
    stepMode: 'vertex' | 'instance';
    attributes: VertexAttribute[];
}
/** Standard vertex layout: position(3) + normal(3) + uv(2) + tangent(4) */
export declare const STANDARD_VERTEX_LAYOUT: VertexBufferLayout;
/** Instance data layout: model matrix (4x4) + color (4) */
export declare const INSTANCE_LAYOUT: VertexBufferLayout;
export interface GPUTextureRef {
    id: string;
    uri?: string;
    width: number;
    height: number;
    format: GPUTextureFormatType;
    mipLevels: number;
}
export interface PBRMaterial {
    type: 'pbr';
    albedo: [number, number, number, number];
    albedoTexture?: GPUTextureRef;
    metallic: number;
    roughness: number;
    metallicRoughnessTexture?: GPUTextureRef;
    normalTexture?: GPUTextureRef;
    normalScale: number;
    occlusionTexture?: GPUTextureRef;
    occlusionStrength: number;
    emissive: [number, number, number];
    emissiveTexture?: GPUTextureRef;
    emissiveIntensity: number;
    alphaMode: 'opaque' | 'mask' | 'blend';
    alphaCutoff: number;
    doubleSided: boolean;
}
export interface UnlitMaterial {
    type: 'unlit';
    color: [number, number, number, number];
    texture?: GPUTextureRef;
    alphaMode: 'opaque' | 'mask' | 'blend';
    alphaCutoff: number;
}
export interface SpriteMaterial {
    type: 'sprite';
    texture: GPUTextureRef;
    tint: [number, number, number, number];
    uvRect: [number, number, number, number];
    pixelPerfect: boolean;
}
export interface CustomMaterial {
    type: 'custom';
    shaderCode: string;
    uniforms: Record<string, number | number[] | GPUTextureRef>;
    blendMode: GPUBlendModeType;
}
export type RenderMaterial = PBRMaterial | UnlitMaterial | SpriteMaterial | CustomMaterial;
export declare const DEFAULT_PBR: PBRMaterial;
export interface GPULight {
    category: LightCategory;
    color: [number, number, number];
    intensity: number;
    /** World-space position (point/spot/area) */
    position?: [number, number, number];
    /** Direction (directional/spot) */
    direction?: [number, number, number];
    /** Range for point/spot (0 = infinite) */
    range?: number;
    /** Inner/outer cone angle in radians (spot only) */
    innerConeAngle?: number;
    outerConeAngle?: number;
    /** Cast shadows */
    castShadow: boolean;
    shadowMapSize?: number;
    shadowBias?: number;
}
export interface RenderBatch {
    id: string;
    vertexData: Float32Array;
    indexData: Uint32Array;
    instanceCount: number;
    instanceData?: Float32Array;
    material: RenderMaterial;
    layer: number;
    castShadow: boolean;
    receiveShadow: boolean;
}
export interface ClusteredLightConfig {
    tileCountX: number;
    tileCountY: number;
    sliceCount: number;
    maxLightsPerCluster: number;
}
export interface ShadowConfig {
    enabled: boolean;
    mapSize: number;
    cascadeCount: number;
    cascadeSplitLambda: number;
    bias: number;
    normalBias: number;
    pcfRadius: number;
}
export interface PostProcessConfig {
    enabled: boolean;
    effects: PostEffectSettings[];
    hdrEnabled: boolean;
    toneMapping: ToneMappingMode;
    exposure: number;
    gamma: number;
}
export interface PostEffectSettings {
    type: PostEffectType;
    enabled: boolean;
    intensity: number;
    params: Record<string, number>;
}
export interface WebGPURenderConfig {
    canvasFormat: GPUTextureFormatType;
    sampleCount: number;
    maxLights: number;
    clusteredLighting: ClusteredLightConfig;
    shadows: ShadowConfig;
    postProcess: PostProcessConfig;
    maxInstances: number;
    depthPrepassEnabled: boolean;
    frustumCulling: boolean;
    occlusionCulling: boolean;
    sortTransparents: boolean;
}
export declare const DEFAULT_RENDER_CONFIG: WebGPURenderConfig;
export interface GPUResourceHandle {
    id: string;
    type: 'buffer' | 'texture' | 'sampler' | 'pipeline' | 'bind-group';
}
export interface GPUStats {
    drawCalls: number;
    triangles: number;
    instances: number;
    textureMegabytes: number;
    bufferMegabytes: number;
    pipelineSwitches: number;
    frameTimeMs: number;
    gpuTimeMs: number;
}
/** Track GPU resource allocations */
export declare class GPUResourceTracker {
    private resources;
    private totalBytes;
    register(id: string, type: string, sizeBytes: number, label?: string): void;
    release(id: string): void;
    getStats(): {
        count: number;
        totalMB: number;
        byType: Record<string, number>;
    };
    clear(): void;
}
export interface RenderPassDescriptor {
    type: RenderPassType;
    label: string;
    enabled: boolean;
    order: number;
}
/** Collects batches, sorts, and generates draw calls per pass */
export declare class RenderPipelineManager {
    private config;
    private passes;
    private batches;
    private lights;
    private stats;
    private resourceTracker;
    constructor(config?: Partial<WebGPURenderConfig>);
    private initDefaultPasses;
    getConfig(): Readonly<WebGPURenderConfig>;
    updateConfig(patch: Partial<WebGPURenderConfig>): void;
    submitBatch(batch: RenderBatch): void;
    submitLight(light: GPULight): void;
    clearFrame(): void;
    /** Sort and organize batches for rendering */
    preparePasses(): Map<RenderPassType, RenderBatch[]>;
    private isOpaque;
    /** Generate draw statistics */
    computeStats(): GPUStats;
    getLights(): readonly GPULight[];
    getPasses(): readonly RenderPassDescriptor[];
    getResourceTracker(): GPUResourceTracker;
}
export interface WebGPURendererState {
    initialized: boolean;
    supported: boolean;
    adapterInfo: string;
    deviceLimits: Record<string, number>;
}
/** High-level WebGPU renderer that manages device, pipelines, and frame submission */
export declare class WebGPURenderer {
    private pipeline;
    private state;
    private frameCallback;
    constructor(config?: Partial<WebGPURenderConfig>);
    /** Check WebGPU support */
    isSupported(): boolean;
    /** Initialize the WebGPU device */
    initialize(): Promise<boolean>;
    /** Submit a renderable batch */
    submit(batch: RenderBatch): void;
    /** Submit a light */
    addLight(light: GPULight): void;
    /** Execute full render frame */
    renderFrame(): GPUStats;
    /** Register frame callback */
    onFrame(cb: (stats: GPUStats) => void): void;
    getState(): Readonly<WebGPURendererState>;
    getPipeline(): RenderPipelineManager;
    /** Get available shader sources for debug/customization */
    getShaderSources(): Record<string, string>;
    destroy(): void;
}
export interface PostProcessPass {
    type: PostEffectType;
    enabled: boolean;
    intensity: number;
    params: Record<string, number>;
}
export declare const BLOOM_DEFAULTS: PostProcessPass;
export declare const FXAA_DEFAULTS: PostProcessPass;
export declare const SSAO_DEFAULTS: PostProcessPass;
export declare const DOF_DEFAULTS: PostProcessPass;
export declare const COLOR_GRADING_DEFAULTS: PostProcessPass;
/** Manage ordered post-process stack */
export declare class PostProcessStack {
    private passes;
    add(pass: PostProcessPass): void;
    remove(type: PostEffectType): void;
    setEnabled(type: PostEffectType, enabled: boolean): void;
    setIntensity(type: PostEffectType, intensity: number): void;
    getActive(): PostProcessPass[];
    getAll(): readonly PostProcessPass[];
    reorder(order: PostEffectType[]): void;
    clear(): void;
}
export type QualityPreset = 'low' | 'medium' | 'high' | 'ultra';
export declare const QUALITY_PRESET_CONFIGS: Record<QualityPreset, Partial<WebGPURenderConfig>>;
export declare function applyQualityPreset(preset: QualityPreset): WebGPURenderConfig;
