Hi all,
Although the PagedVolume (previously LargeVolume) allows the user to create a volume of any size, this size still needs to be specified on volume creation. I feel this is an unnecessary restriction, and that all PagedVolumes should be created 'infinitely' large (within constraints of 32-bit voxel positions).
The idea is that you would create a PagedVolume and provide your paging functions, which work in the same way as at the moment. Any time you try to read or write a voxel PolyVox first ensures that the appropriate chunk exists in memory by calling the paging functions you supply. PolyVox would no longer check that the requested voxel position lies within any prespecified bounds.
I don't think there are any real advantages to keeping the PagedVolume as having a fixed size so I think this change makes sense. It will boost performance and simplify the code, as profiling has shown that the PagedVolume::Sampler is being slowed down by the (surprisingly convoluted) logic which ensures it is always pointing at a valid voxel position.
However, there is one catch. Currently PolyVox provides the concept of 'wrap modes' which work similarly to OpenGL - that is you can specify what will happen when you try to access a voxel outside the volume (clamp, border, etc). This will no longer be possible (at least for PagedVolume, not sure about the RawVolume) because all voxels will be considered to be inside the volume. So, is anyone making explicit use of wrap modes and feels this might be a problem?
The above is just my initial thoughts... I will dig into the code over the coming days so maybe I find a reason why it can't be changed. I'll also be giving consideration to
iteration and
threading as I review the code.