/**
 * Voxel ("Nanite voxel") impostor baker.
 *
 * Inspiration: the Witcher 4 / UE5.6+ "Nanite Foliage" tech demo, which
 * swaps alpha-tested cards for a near-pixel-sized voxel representation
 * at distance. Each "voxel" is a point with a world-space size, carrying
 * a baked G-buffer (position, normal, albedo, ORM) — no alpha. Targeted
 * at very low point counts (128–2048), where each voxel projects to
 * around one screen pixel at the impostor's design viewing distance.
 *
 * Bake strategy: control the point count by **atlas resolution**, not
 * by varying the voxel grid resolution at a fixed atlas. Reason: varying
 * the voxel grid at fixed atlas biases each cell's centroid toward
 * whichever views happened to land more atlas pixels in that cell — a
 * systematic directional bias that grows with coarser grids. Re-baking
 * the atlas at the right resolution avoids that, because each bake
 * produces fresh, evenly-distributed samples in the target frequency
 * range.
 *
 * Search algorithm:
 *
 *   PHASE 1 — coarse halving. Start at `resolution`, halve atlas
 *   resolution each iteration until the point count fits budget.
 *   O(log) iterations, each a full GPU bake.
 *
 *   PHASE 2 — binary-search refinement. Between the last over-budget
 *   resolution and the first under-budget one, binary-search in
 *   steps of `frames` (the smallest atlas-resolution granularity
 *   that keeps each per-frame tile integer-sized). Pick the
 *   largest atlas resolution that still fits — that gives the most
 *   points up to budget = best detail.
 *
 * Each iteration:
 *   1. Re-bake atlas at candidate resolution via {@link ImpostorBaker}.
 *   2. Read back samples on CPU.
 *   3. Voxelise at grid_res = atlas_res / frames (matched 1:1 so each
 *      atlas pixel maps to roughly one voxel cell).
 *   4. Count, compare to budget, advance search.
 *
 * Re-baking costs a GPU pass per iteration (~250 draws for 16² frames),
 * so a full search is ~10 bakes ≈ a couple seconds on modern hardware.
 * Acceptable for one-shot offline impostor prep where quality
 * dominates.
 */
export class VoxelImpostorBaker {
    /**
     * @type {THREE.WebGLRenderer|null}
     * @private
     */
    private _renderer;
    /**
     *
     * @param {THREE.WebGLRenderer} v
     */
    set renderer(arg: import("three").WebGLRenderer);
    /**
     * @param {object} params
     * @param {{mesh:ShadedGeometry, transform:mat4}[]} params.objects
     * @param {number} [params.point_budget]    target maximum point count.
     *      The baker may produce fewer if the input is too small for the
     *      target, but never more.
     * @param {ImpostorCaptureType} [params.capture_type]
     * @param {number} [params.frames]          atlas frame count per axis
     *      (total sampled views = frames²). Also the granularity of the
     *      atlas-resolution binary search: candidates must be multiples
     *      of `frames` so each per-frame tile stays integer-sized.
     *      Default 16.
     * @param {number} [params.resolution]      maximum atlas resolution.
     *      Upper bound of the search; the baker may pick a smaller value
     *      to fit the budget. Default 1024.
     * @returns {VoxelImpostorDescription}
     */
    bake({ objects, point_budget, capture_type, frames, resolution }: {
        objects: {
            mesh: ShadedGeometry;
            transform: mat4;
        }[];
        point_budget?: number;
        capture_type?: ImpostorCaptureType;
        frames?: number;
        resolution?: number;
    }): VoxelImpostorDescription;
    /**
     * Pack the search result into a final VoxelImpostorDescription.
     * @private
     */
    private _compose_result;
}
import { ImpostorCaptureType } from "../octahedral/ImpostorCaptureType.js";
import { VoxelImpostorDescription } from "./VoxelImpostorDescription.js";
//# sourceMappingURL=VoxelImpostorBaker.d.ts.map