.nvdb and .wvdb
Two formats, two jobs. Which one to ship, and how to go between them.
Both are supported by @pmndrs/vdb/tools, for different jobs (D14). The full-resolution vs 128³ demo
splits one volume between the two, with GPU bytes, file size and error per side.
Which to use
- Use
.nvdbfor the data you render. It is the exact format: nothing is resampled, and the GPU reads the bytes you wrote. It is the format ofVDBGridPool,VDBVolumeMaterialand the sparse source. - Use
.wvdbwhen you already have it, or when you want his delivery path: it has coarse-first streaming and an existing user base. The dense frame-renderer source reads it. - From a
.vdb, go to.nvdbwithbuildFromVdb(thenquantizeto shrink it), or to.wvdbwithvdbToWvdb.
Between them
.wvdbto.nvdb:wvdbDenseToNvdb(wvdbDenseVolume(file))converts a LOD voxel for voxel into a Float grid (texelkbecomesk / 255, zero texels inactive), each axis with its own voxel size (a bake rounds each side's texel count on its own), so the grid sits where the.wvdbbox puts it. It also returnssparseSourceOptions(the texture index box, the dense stats and the box), to spread into thevdbSparseSourceoptions so the sparse copy lines up with the dense source..nvdbto.wvdb:nvdbToWvdb(image, options). It samples over the bbox, point-sampled by default like his CLI (D27); passsampling: 'box'for sources much finer than the texel grid.
Provenance
.wvdb reading, writing and baking are ported from mjurczyk/openvdb (MIT),
pinned at 75e7345 (v0.26.0). Where the code departs from his, the divergence is recorded in
DIVERGES.md.