Skip to content

Instantly share code, notes, and snippets.

@DocSavage
Last active April 19, 2020 14:30
Show Gist options
  • Save DocSavage/069a53c1b56696bf9dfa9f39463b0a7e to your computer and use it in GitHub Desktop.
Save DocSavage/069a53c1b56696bf9dfa9f39463b0a7e to your computer and use it in GitHub Desktop.
VNC NG-precomputed shard file debugging
VNC Pre-computed sharded volume worksheet
Scale 0:
Preshift bits = 9
Minishard bits = 6 2^15 chunks if no collisions = 32 KiChunks @ 64^3 chunks (262 KiVoxels) = 8.46 GiVoxels
Shard bits = 16
Block (335, 438, 1024) -> corresponds to 64^3 with first voxel at (21440, 28032, 66536)
X block 335 = 14F
Y block 438 = 1B6
Z block 1024 = 400
Scale 0, dim 0 with size 42943 requires 10 bits.
Scale 0, dim 1 with size 56068 requires 10 bits.
Scale 0, dim 2 with size 82276 requires 11 bits.
Minishard mask: 000000000000003f
0011 1111
Shard mask: 00000000003fffc0
0000 0000 0000 0011 1111 1111 1111 1100 0000
|--- shard bits ---|| mini|| preshift|
16 bits 12 bits 8 bits 4 bits
------------------------ -zzy xzyx zyxz yxzy xzyx zyxz yxzy xzyx
Compressed Morton: 0100 0011 0100 0101 0010 0010 1101 1001
Hex: 4 3 4 5 2 2 d 9
Compressed Morton hex = 434522d9
Shard file = binary 1000 0110 1000 1010 = hex 868a
Minishard = binary 0001 0001 = hex 11
on lookup to existing shard file, that minishard has 512 entries
compressed morton block range [3452200,34523ff]
Note that since shard bits determine shard file and are not the MSB, the chunks may not be
contiguous in morton space due to collisions from the 18 most-significant bits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment