NVIDIA / gvdb-voxels

Sparse volume compute and rendering on NVIDIA GPUs
Other
679 stars 145 forks source link

SaveVBX and LoadVBX filespec inconsistencies. #80

Closed digbeta closed 4 years ago

digbeta commented 4 years ago

First off - GVDB is amazing. Really great work...

Using GVDB version 1.11, there are a few small issues in the Save/LoadVBX functions.

1 - SaveVBX appears to write grid offsets starting at offset 6, effectively stomping on the grid transforms written to the file earlier in the function.

2 - As has been noted #19 , LoadVBX is out of sync with SaveVBX in reading the bitmask field when major >=2.

These are easy fixes, but I also think these functions could be changed to serialize/deserialize something like a vbxfile_t object(s) which could better handle versioning or updates in the future.

Happy to do a pull request or anything else that might be helpful. Great work!

NBickford-NV commented 4 years ago

Hi digbeta,

Thank you for the notes and the bugs! I just pushed commit c530d1aa, which should fix these two issues (it also fixes a pool group zeroing issue that appeared in exported VBX files, and documents these changes in GVDB_FILESPEC.txt). The relevant change for the first issue should be lines 1743-1744 of gvdb_volume_gvdb.cpp, and the fix for #19 should now be in lines 570-579 - let me know if this fixes what you're seeing!

For the vbxfile_t object idea, could you maybe tell me more about the architecture you're thinking of - e.g. maybe something where we have a different struct for the file header per version of the file format, and then load data from earlier versions by converting a v1.0 vbxfile_t object to a v1.11 vbxfile_t object, for instance?

digbeta commented 4 years ago

Hi, Neil -

Confirming the fixes work. Regarding the vbxfile_t, it might be more complicated than I realized as I dug into the structure a bit more. I am going to think on it a bit more and can circle back with you when I have some more time to dig into it a bit more. Thanks again for the quick fixes!

-Eric