kklouzal wrote:
Also for whatever reason if I fill the density of a voxel to 255, I cout the density before it goes in, then I get the density of the same voxel it's magically 15.
The MaterialDensityPair44 type only uses 4 bits to store the material and the density, so the maximum values are 15. If you need more range you can try the MaterialDensityPair88 type instead.
kklouzal wrote:
...
Why does this error occur?
I'm not exactly sure but I must admit I have seen some issues here before. There is a warning printed saying "The last accessed block is being erased from the uncompressed cache", and I'm not sure if maybe this should be an error (i.e. perhaps it would catch the problem earlier). This is where the most recent changes in PolyVox have been made so there could be a bug here.
I assume you code snippet is from some kind of custom Pager implementation which stores data to and from a network location? If so I would recommend that you take a look at the FilePager that comes with PolyVox, and notice how it does not iterate over the voxels but instead just loads/saves the compressed data as a single binary blob. It's probably a better approach anyway, and might bypass your problem.