/** * Routing predicates for the opaque/transparent pipeline split. * * Lens / Pset colour overrides are drawn by a second "overlay paint" pass * whose pipeline uses `depthCompare: 'equal'` so it only paints where the * base draw already wrote depth. The transparent pipeline runs with * `depthWriteEnabled: false`, so a colour override on an entity whose base * draw is transparent (IfcSpace, IfcOpeningElement, glass, …) silently * fails — the equality test never matches. * * To fix that, the renderer promotes the base draw of overridden entities * to the opaque pipeline so depth gets written and the overlay paint * succeeds. To avoid turning non-overridden batchmates opaque, batches * with mixed override membership are split into a "promoted" sub-batch * (all overridden) and a "remaining" sub-batch (all not), each routed * through its appropriate pipeline. * * These helpers express the routing decision as pure functions so they * can be unit-tested without a GPU device. See issue #677. */ export type RGBAOverrideMap = ReadonlyMap; export declare const OPAQUE_ALPHA_CUTOFF = 0.99; /** * Decide whether a mesh should render through the transparent pipeline. * * @param alpha Resolved alpha for the mesh (post `transparencyOverrides`). * @param transparency Optional PBR transparency (IfcSurfaceStyleRendering). * @param expressId The mesh's expressId, used to consult `colorOverrides`. * @param colorOverrides Active lens / Pset override map, or null when none. * * @returns `true` if the mesh should route to the transparent pipeline. * `false` means route to the opaque pipeline (writes depth). */ export declare function shouldRouteMeshTransparent(alpha: number, transparency: number, expressId: number, colorOverrides: RGBAOverrideMap | null): boolean; /** * Decide whether a batch (or sub-batch) should render through the transparent * pipeline. A batch is promoted to opaque **only when every id in it** carries * a deliberate override — i.e. when promotion can't make any unrelated * batchmate opaque. Mixed batches must be split upstream via * {@link splitVisibleIdsByPromotion}; the splitter calls this helper on each * homogeneous sub-batch. * * @param alpha Resolved batch alpha (post `transparencyOverrides`). * @param expressIds The (sub-)batch's expressIds. * @param colorOverrides Active lens / Pset override map, or null when none. */ export declare function shouldRouteBatchTransparent(alpha: number, expressIds: ReadonlyArray, colorOverrides: RGBAOverrideMap | null): boolean; /** * Partition a visible-id set into the subset that needs opaque-pipeline * promotion (deliberate colour overrides, alpha ≥ 0.2) and the rest. * * Used by the renderer's batch loop when a transparent parent batch has * mixed override membership: each subset becomes its own partial sub-batch * so non-overridden batchmates keep their native transparent routing. * * Returns `null` when no split is needed — either the override map is empty * or no id in `visibleIds` carries a deliberate override. The caller should * then route the whole input through its native pipeline. */ export declare function splitVisibleIdsByPromotion(visibleIds: Iterable, colorOverrides: RGBAOverrideMap | null): { promoted: Set; remaining: Set; } | null; //# sourceMappingURL=overlay-routing.d.ts.map