import { generateSpecularPrefilterMipLevels } from "./EnvironmentMapResources.js";
export function createExternalParityPmrem(source, options = {}) {
    const mipLevels = generateSpecularPrefilterMipLevels(source, {
        levels: options.levels ?? 6,
        blurRadius: options.blurRadius ?? 3
    });
    const levels = mipLevels.map((level, index) => ({
        level: index,
        width: level.width,
        height: level.height,
        roughness: Number((index / Math.max(1, mipLevels.length - 1)).toFixed(4)),
        byteLength: level.data.byteLength
    }));
    return {
        textureLabel: options.textureLabel ?? "external-parity-pmrem-specular",
        mipLevels,
        levels,
        diagnostics: {
            mipCount: mipLevels.length,
            maxRoughness: levels.at(-1)?.roughness ?? 0,
            totalByteLength: levels.reduce((sum, level) => sum + level.byteLength, 0),
            directionalReflectionReady: mipLevels.length >= 4 && mipLevels[0].width > mipLevels.at(-1).width
        }
    };
}
//# sourceMappingURL=PMREM.js.map