builtin-plugins
- ..
- .metadata168 B
- README.md738 B
- plugin.wasm201 KB
- plugin.yaml186 B
- surface.module
README.md
openvdb
Reads OpenVDB files for the .vdb importer, which turns one into a .zvol
volume.
local openvdb = require("@builtin::plugins.openvdb")
local grid = openvdb.parse(vfs.read("/zero/source/fire.vdb"))
print(grid.width, grid.height, grid.depth, grid.mode)
-- grid.voxels: width * height * depth * 4 bytes, RGBA8
The first float grid in the file is read: density grids (smoke, fire, fuel) normalised by their own range, and level sets (values straddling zero) with the inside opaque. A grid larger than 256 on a side is downsampled by a whole stride. Blosc-compressed grids are not read; re-export them with ZIP or no compression.
It takes the file's bytes and answers the grid, and reads and writes nothing itself.