import type { BoundsSpec } from "./bounds.js"; import type { CameraVisibilityContext } from "./camera.js"; /** * Global render-culling behavior. Defaults favor correctness and visual stability over * aggressive rejection: a generous preload margin, hysteresis, and a large default render * distance so upgrading the engine never makes an existing game's objects vanish. */ export interface CullingSettings { readonly enabled: boolean; readonly frustumCulling: boolean; readonly distanceCulling: boolean; /** Occlusion culling is opt-in and off until proven reliable for the renderer. */ readonly occlusionCulling: boolean; readonly defaultMinRenderDistance: number; readonly defaultMaxRenderDistance: number; /** World units the preload region extends beyond the visible frustum, hiding pop-in. */ readonly preloadMargin: number; /** World-unit band added when re-testing a previously visible object, preventing boundary flicker. */ readonly hysteresis: number; } export declare const DEFAULT_CULLING_SETTINGS: CullingSettings; export interface StreamingSettings { readonly enabled: boolean; /** Extra world units around the camera whose assets are preloaded ahead of visibility. */ readonly preloadMargin: number; /** Idle unload delay; resident-byte pressure can evict unprotected assets sooner. */ readonly unloadGraceSeconds: number; readonly maxLoadsPerFrame: number; /** Maximum unresolved loads, including cancelled work until its loader settles. Zero pauses new loads. */ readonly maxConcurrentLoads: number; readonly maxUnloadsPerFrame: number; /** Resident-byte target, enforced on ticks within maxUnloadsPerFrame; protected assets may exceed it. */ readonly maxResidentBytes: number; /** Budget eviction order. Ties use oldest activity then asset id for deterministic selection. */ readonly residentEvictionOrder: "oldest" | "largest"; /** Small shared assets survive idle unloading, but remain eligible under resident-byte pressure. */ readonly keepResidentBytes: number; } export declare const DEFAULT_STREAMING_SETTINGS: StreamingSettings; /** * Per-object visibility/streaming overrides. Also the shape used at the layer, scene, and * global-override levels — resolution merges object → layer → scene → global-override, so a * game can, say, mark a whole "hud" layer alwaysVisible without touching each object. */ export interface ObjectVisibilityOverrides { /** Bypass all render culling — always submitted (UI, skybox, camera-attached, marked always-visible). */ readonly alwaysVisible?: boolean; /** Never auto-unload this object's assets. */ readonly neverUnload?: boolean; readonly minRenderDistance?: number; readonly maxRenderDistance?: number; readonly preloadMargin?: number; readonly cullingDisabled?: boolean; readonly streamingDisabled?: boolean; readonly classification?: "static" | "dynamic"; readonly bounds?: BoundsSpec; /** * Final say on render visibility. Return true/false to force, or undefined to defer to the * standard frustum+distance+occlusion pipeline. Evaluated per relevant camera. */ readonly customVisibility?: (camera: CameraVisibilityContext) => boolean | undefined; /** Pin the object's assets resident regardless of distance. */ readonly pinned?: boolean; } export interface ResolvedOverrides { alwaysVisible: boolean; neverUnload: boolean; minRenderDistance: number | undefined; maxRenderDistance: number | undefined; preloadMargin: number | undefined; cullingDisabled: boolean; streamingDisabled: boolean; classification: "static" | "dynamic" | undefined; bounds: BoundsSpec | undefined; customVisibility: ((camera: CameraVisibilityContext) => boolean | undefined) | undefined; pinned: boolean; } /** Merge override layers by precedence: earlier arguments win. Pass object, then layer, then scene, then global. */ export declare function resolveOverrides(...layers: readonly (ObjectVisibilityOverrides | undefined)[]): ResolvedOverrides; export declare function mergeCullingSettings(base: CullingSettings, patch: Partial): CullingSettings; export declare function mergeStreamingSettings(base: StreamingSettings, patch: Partial): StreamingSettings;