Well.... if I'd say that it's top-secret, I'd lie.
Consider a grid of cells,
with inside it, another grid of smaller cells,
with inside it, another grid of smaller cells,
with inside it, another grid of smaller cells,
etc.
Which 'center cells' inside the LOD should be culled to prevent overlap?
That's what this formula calculates.
BTW, the placement of the lower LOD-grids, is corrected (snapped) by:
1 2 3 4 5 6 7 8
| for (int lod = 0; lod < lods; lod++) { for (int k = 0; k <= lods; k++) { x -= (((xCameraTile >> k) & 1)) << k; z -= (((zCameraTile >> k) & 1)) << k; } } |
If there would be a direct formula for that one... I'd be thrilled, but I wouldn't really need it

I create this kind of black-magic code (for me at least) by writing out the LOD-math for a few levels,
then searching for patterns, transforming it into formulas, where the formula's don't make much
sense to me, to be honest. In the documentation I write how I created them.
I just don't have the time to examin what really happens. Not really interested either
