/** * Generic warmup driver shared between the planet (`useBody`) and star * (`useStar`) factories. Runs a sequence of compile phases against a * supplied renderer / camera, exploiting `KHR_parallel_shader_compile` * via `WebGLRenderer.compileAsync` so the main thread stays responsive * while the GPU driver links programs in the background. * * Each phase carries a list of root `Object3D`s to compile. The targets * are temporarily re-parented under a transient `Scene` for the call to * `compileAsync` and then restored to their original parents — this * lets callers warm up meshes that are not yet attached to the body * group (e.g. the interactive sol mesh, swapped in only on * `interactive.activate()`, or the atmo shell, mounted only when the * view switcher selects `'surface'` / `'shader'`). * * Phases run sequentially so progress reports correspond to discrete * shader groups; `KHR_parallel_shader_compile` still parallelises the * compilation of multiple programs *within* a phase. */ import * as THREE from 'three'; import type { WarmupOptions, WarmupPhase } from '../types/bodyHandle.types'; /** * Single phase descriptor consumed by {@link warmupBody}. Built by * `useBody` / `useStar` from the body's actual handles — empty `targets` * lists are filtered out before reporting so the `total` reflects only * meaningful steps. */ export interface WarmupPhaseSpec { /** Stable phase code surfaced in {@link WarmupProgress.phase}. */ phase: WarmupPhase; /** Default English label surfaced in {@link WarmupProgress.label}. */ label: string; /** Roots whose materials must be compiled in this phase. */ targets: readonly THREE.Object3D[]; } /** * Pre-compiles the body's shader programs phase-by-phase. The renderer * and camera belong to the caller (the lib never owns either). Phases * with no targets are skipped — they would compile nothing and only * pollute the `total` denominator. * * @param renderer - Renderer hosting the WebGL context. * @param camera - Any scene camera (matrices are not bound into the * compiled program — multi-camera scenes still only * need a single warmup pass). * @param phases - Phase specs in execution order. The implementation * appends a synthetic `'done'` phase after the last * compile resolves. * @param options - Optional progress hook. */ export declare function warmupBody(renderer: THREE.WebGLRenderer, camera: THREE.Camera, phases: readonly WarmupPhaseSpec[], options?: WarmupOptions): Promise; //# sourceMappingURL=warmupBody.d.ts.map