Builtin Library
README.md
VDB → ZVOL importer
Claims .vdb (OpenVDB) writes and produces a sibling .zvol — the
engine-native dense RGBA8 volumetric format consumed by the volumetrics
system.
This is a standard importer asset: init.luau returns a
{ canImport, import } module that the importer dispatcher
(@builtin::assetTypes.importer) loads lazily and runs only when a matching
file is written. It does not execute anything at load time.
Pipeline
- Real parse — if the
openvdbplugin in the builtin library (@builtin::plugins.openvdb) is loaded, the VDB B-tree is parsed into a dense RGBA8 voxel buffer and wrapped in a 64-byte ZVOL header. - Procedural fallback — without the plugin, a deterministic
noise-modulated torus is synthesised (FNV-1a hash of the first 256 source
bytes seeds it) so the importer + demo wiring stays functional. The
produced_byfield in the result distinguishes the two paths.
ZVOL header (64 bytes)
| offset | size | field |
|---|---|---|
| 0 | 4 | magic ZVOL |
| 4 | 4 | u32 version (1) |
| 8 | 4 | u32 width |
| 12 | 4 | u32 height |
| 16 | 4 | u32 depth |
| 20 | 4 | u32 format (1 = rgba8) |
| 24 | 12 | f32[3] aabb_min |
| 36 | 12 | f32[3] aabb_max |
| 48 | 16 | reserved |
| 64 | … | voxel data, w*h*d*4 bytes, XY-major Z-slowest |