Selection loop
Resolve the knobs once per frame, reuse scratch buffers, and let the selector tell you what limited the frame.
import {
createLodScratch,
createLodSelection,
resolveLodOptions,
selectVisible,
} from '@voxelkloud/view/lod'
const opts = resolveLodOptions({ targetScreenError: 1.35, pointBudget: 3_000_000 })
const scratch = createLodScratch(tree.nodeCount)
const selection = createLodSelection(opts.maxNodes)
selectVisible(tree, cameraState, opts, scratch, selection)