How to compute a 3D Morton number (interleave the bits of 3 ints)
You can use the same technique. I’m assuming that variables contain 32-bit integers with the highest 22 bits set to 0 (which is a bit more restrictive than necessary). For each variable x containing one of the three 10-bit integers we do the following: x = (x | (x << 16)) & 0x030000FF; x = … Read more