DeclutterFrontierScratch
Defined in: network/lod.ts:1151
Reusable scratch for declutterFrontier (#213) — engine-owned so the per-frame thinning
allocates nothing steady-state: the projected centres/radii, the typed sort keys + visit order,
the kept flags, the shared declutter grid, and the output buffer are all grown on demand (to the
largest frontier seen) and reused. The returned kept set is a subarray view of out, valid
until the next call with the same scratch.
Properties
Section titled “Properties”counts
Section titled “counts”counts:
Uint32Array
Defined in: network/lod.ts:1168
Per-pass byte histogram / running offsets for the radix sort.
grid:
DeclutterScratch
Defined in: network/lod.ts:1172
Uniform-grid scratch for the shared declutterScreen engine.
kept:
Uint8Array
Defined in: network/lod.ts:1170
Kept flags from declutterScreen (fully rewritten each call — no clearing needed).
key:
Float32Array
Defined in: network/lod.ts:1158
Per-frontier-index importance key (tree.weight[frontier[i]]), gathered once per call so the
sort reads one flat array — not two boxed tree.weight[frontier[i]] lookups per compare.
keyBits
Section titled “keyBits”keyBits:
Uint32Array
Defined in: network/lod.ts:1160
Bit view over key’s SAME buffer; transformed in place to the descending-order radix key.
keyBits2
Section titled “keyBits2”keyBits2:
Uint32Array
Defined in: network/lod.ts:1162
Radix scatter partner for keyBits.
order:
Uint32Array
Defined in: network/lod.ts:1164
Frontier-index visit order; the [0, F) prefix is sorted descending by key each call.
order2
Section titled “order2”order2:
Uint32Array
Defined in: network/lod.ts:1166
Radix scatter partner for order.
out:
Uint32Array
Defined in: network/lod.ts:1174
Kept frontier ids; only the returned subarray(0, n) prefix is valid per call.
pr:
Float64Array
Defined in: network/lod.ts:1155
px:
Float64Array
Defined in: network/lod.ts:1153
Projected screen centres + on-screen draw radii, parallel to the frontier.
py:
Float64Array
Defined in: network/lod.ts:1154