bonsairobo / building-blocks

A voxel library for real-time applications.
MIT License
369 stars 30 forks source link

OctreeChunkIndex: Fix num_lods calculation #25

Closed superdump closed 3 years ago

superdump commented 3 years ago
superchunk_shape =  2^(chunk_log2 + num_lods - 1)
log2(superchunk_shape) = log2(2^(chunk_log2 + num_lods - 1)) = (chunk_log2 + num_lods - 1) * log2(2) = (chunk_log2 + num_lods - 1)
num_lods = log2(superchunk_shape) - chunk_log2 + 1