@pmndrs/vdb 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +727 -0
- package/LICENSE +21 -0
- package/README.md +496 -2
- package/THIRD_PARTY_NOTICES.md +315 -0
- package/dist/core/compute/atlas.d.ts +102 -0
- package/dist/core/compute/atlas.js +103 -0
- package/dist/core/compute/atlas.js.map +1 -0
- package/dist/core/compute/index.d.ts +13 -0
- package/dist/core/compute/index.js +9 -0
- package/dist/core/compute/index.js.map +1 -0
- package/dist/core/compute/majorant-build.d.ts +45 -0
- package/dist/core/compute/majorant-build.js +193 -0
- package/dist/core/compute/majorant-build.js.map +1 -0
- package/dist/core/compute/multi-scale.d.ts +155 -0
- package/dist/core/compute/multi-scale.js +684 -0
- package/dist/core/compute/multi-scale.js.map +1 -0
- package/dist/core/compute/pyramid.d.ts +120 -0
- package/dist/core/compute/pyramid.js +468 -0
- package/dist/core/compute/pyramid.js.map +1 -0
- package/dist/core/compute/shared.d.ts +116 -0
- package/dist/core/compute/shared.js +211 -0
- package/dist/core/compute/shared.js.map +1 -0
- package/dist/core/compute/stats.d.ts +78 -0
- package/dist/core/compute/stats.js +193 -0
- package/dist/core/compute/stats.js.map +1 -0
- package/dist/core/compute/value-transform.d.ts +30 -0
- package/dist/core/compute/value-transform.js +64 -0
- package/dist/core/compute/value-transform.js.map +1 -0
- package/dist/core/errors.d.ts +21 -0
- package/dist/core/errors.js +17 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/frame/emission.d.ts +85 -0
- package/dist/core/frame/emission.js +422 -0
- package/dist/core/frame/emission.js.map +1 -0
- package/dist/core/frame/environment.d.ts +47 -0
- package/dist/core/frame/environment.js +178 -0
- package/dist/core/frame/environment.js.map +1 -0
- package/dist/core/frame/index.d.ts +39 -0
- package/dist/core/frame/index.js +27 -0
- package/dist/core/frame/index.js.map +1 -0
- package/dist/core/frame/kernels.d.ts +115 -0
- package/dist/core/frame/kernels.js +496 -0
- package/dist/core/frame/kernels.js.map +1 -0
- package/dist/core/frame/limits.d.ts +67 -0
- package/dist/core/frame/limits.js +109 -0
- package/dist/core/frame/limits.js.map +1 -0
- package/dist/core/frame/phase.d.ts +17 -0
- package/dist/core/frame/phase.js +53 -0
- package/dist/core/frame/phase.js.map +1 -0
- package/dist/core/frame/pipelines.d.ts +49 -0
- package/dist/core/frame/pipelines.js +147 -0
- package/dist/core/frame/pipelines.js.map +1 -0
- package/dist/core/frame/renderer.d.ts +122 -0
- package/dist/core/frame/renderer.js +1712 -0
- package/dist/core/frame/renderer.js.map +1 -0
- package/dist/core/frame/resources.d.ts +71 -0
- package/dist/core/frame/resources.js +100 -0
- package/dist/core/frame/resources.js.map +1 -0
- package/dist/core/frame/scattering.d.ts +97 -0
- package/dist/core/frame/scattering.js +332 -0
- package/dist/core/frame/scattering.js.map +1 -0
- package/dist/core/frame/settings.d.ts +243 -0
- package/dist/core/frame/settings.js +67 -0
- package/dist/core/frame/settings.js.map +1 -0
- package/dist/core/frame/shadows.d.ts +55 -0
- package/dist/core/frame/shadows.js +460 -0
- package/dist/core/frame/shadows.js.map +1 -0
- package/dist/core/frame/types.d.ts +415 -0
- package/dist/core/frame/types.js +49 -0
- package/dist/core/frame/types.js.map +1 -0
- package/dist/core/frame/uniforms.d.ts +105 -0
- package/dist/core/frame/uniforms.js +276 -0
- package/dist/core/frame/uniforms.js.map +1 -0
- package/dist/core/frame/wgsl/chunks.d.ts +4 -0
- package/dist/core/frame/wgsl/chunks.js +728 -0
- package/dist/core/frame/wgsl/chunks.js.map +1 -0
- package/dist/core/frame/wgsl/emission.d.ts +82 -0
- package/dist/core/frame/wgsl/emission.js +353 -0
- package/dist/core/frame/wgsl/emission.js.map +1 -0
- package/dist/core/frame/wgsl/environment.d.ts +42 -0
- package/dist/core/frame/wgsl/environment.js +711 -0
- package/dist/core/frame/wgsl/environment.js.map +1 -0
- package/dist/core/frame/wgsl/gather.d.ts +55 -0
- package/dist/core/frame/wgsl/gather.js +850 -0
- package/dist/core/frame/wgsl/gather.js.map +1 -0
- package/dist/core/frame/wgsl/integrate.d.ts +78 -0
- package/dist/core/frame/wgsl/integrate.js +213 -0
- package/dist/core/frame/wgsl/integrate.js.map +1 -0
- package/dist/core/frame/wgsl/lighting.d.ts +103 -0
- package/dist/core/frame/wgsl/lighting.js +1636 -0
- package/dist/core/frame/wgsl/lighting.js.map +1 -0
- package/dist/core/frame/wgsl/occluders.d.ts +20 -0
- package/dist/core/frame/wgsl/occluders.js +95 -0
- package/dist/core/frame/wgsl/occluders.js.map +1 -0
- package/dist/core/frame/wgsl/resolve.d.ts +19 -0
- package/dist/core/frame/wgsl/resolve.js +205 -0
- package/dist/core/frame/wgsl/resolve.js.map +1 -0
- package/dist/core/frame/wgsl/shadows.d.ts +35 -0
- package/dist/core/frame/wgsl/shadows.js +328 -0
- package/dist/core/frame/wgsl/shadows.js.map +1 -0
- package/dist/core/half.d.ts +11 -0
- package/dist/core/half.js +22 -0
- package/dist/core/half.js.map +1 -0
- package/dist/core/index.d.ts +52 -0
- package/dist/core/index.js +46 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/internal.d.ts +31 -0
- package/dist/core/internal.js +32 -0
- package/dist/core/internal.js.map +1 -0
- package/dist/core/pool/affine.d.ts +34 -0
- package/dist/core/pool/affine.js +100 -0
- package/dist/core/pool/affine.js.map +1 -0
- package/dist/core/pool/allocator.d.ts +32 -0
- package/dist/core/pool/allocator.js +81 -0
- package/dist/core/pool/allocator.js.map +1 -0
- package/dist/core/pool/image-header.d.ts +93 -0
- package/dist/core/pool/image-header.js +194 -0
- package/dist/core/pool/image-header.js.map +1 -0
- package/dist/core/pool/layout.d.ts +198 -0
- package/dist/core/pool/layout.js +316 -0
- package/dist/core/pool/layout.js.map +1 -0
- package/dist/core/pool/limits.d.ts +41 -0
- package/dist/core/pool/limits.js +80 -0
- package/dist/core/pool/limits.js.map +1 -0
- package/dist/core/pool/pool.d.ts +384 -0
- package/dist/core/pool/pool.js +1184 -0
- package/dist/core/pool/pool.js.map +1 -0
- package/dist/core/reference/index.d.ts +6 -0
- package/dist/core/reference/index.js +7 -0
- package/dist/core/reference/index.js.map +1 -0
- package/dist/core/reference/renderer.d.ts +105 -0
- package/dist/core/reference/renderer.js +474 -0
- package/dist/core/reference/renderer.js.map +1 -0
- package/dist/core/reference/wgsl.d.ts +65 -0
- package/dist/core/reference/wgsl.js +803 -0
- package/dist/core/reference/wgsl.js.map +1 -0
- package/dist/core/sequence.d.ts +347 -0
- package/dist/core/sequence.js +548 -0
- package/dist/core/sequence.js.map +1 -0
- package/dist/core/source/brick-cache.d.ts +165 -0
- package/dist/core/source/brick-cache.js +627 -0
- package/dist/core/source/brick-cache.js.map +1 -0
- package/dist/core/source/dense-fill.d.ts +53 -0
- package/dist/core/source/dense-fill.js +377 -0
- package/dist/core/source/dense-fill.js.map +1 -0
- package/dist/core/source/dense.d.ts +50 -0
- package/dist/core/source/dense.js +384 -0
- package/dist/core/source/dense.js.map +1 -0
- package/dist/core/source/sparse-wgsl.d.ts +92 -0
- package/dist/core/source/sparse-wgsl.js +481 -0
- package/dist/core/source/sparse-wgsl.js.map +1 -0
- package/dist/core/source/sparse.d.ts +192 -0
- package/dist/core/source/sparse.js +762 -0
- package/dist/core/source/sparse.js.map +1 -0
- package/dist/core/source/types.d.ts +120 -0
- package/dist/core/source/types.js +9 -0
- package/dist/core/source/types.js.map +1 -0
- package/dist/core/surface/index.d.ts +10 -0
- package/dist/core/surface/index.js +9 -0
- package/dist/core/surface/index.js.map +1 -0
- package/dist/core/surface/level-set-pass.d.ts +140 -0
- package/dist/core/surface/level-set-pass.js +291 -0
- package/dist/core/surface/level-set-pass.js.map +1 -0
- package/dist/core/surface/level-set-wgsl.d.ts +46 -0
- package/dist/core/surface/level-set-wgsl.js +99 -0
- package/dist/core/surface/level-set-wgsl.js.map +1 -0
- package/dist/core/surface/points.d.ts +109 -0
- package/dist/core/surface/points.js +226 -0
- package/dist/core/surface/points.js.map +1 -0
- package/dist/core/types.d.ts +37 -0
- package/dist/core/types.js +32 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/wgsl/api.d.ts +65 -0
- package/dist/core/wgsl/api.js +546 -0
- package/dist/core/wgsl/api.js.map +1 -0
- package/dist/core/wgsl/generate.d.ts +90 -0
- package/dist/core/wgsl/generate.js +678 -0
- package/dist/core/wgsl/generate.js.map +1 -0
- package/dist/core/wgsl/lean.d.ts +50 -0
- package/dist/core/wgsl/lean.js +327 -0
- package/dist/core/wgsl/lean.js.map +1 -0
- package/dist/core/wgsl/level-set.d.ts +58 -0
- package/dist/core/wgsl/level-set.js +200 -0
- package/dist/core/wgsl/level-set.js.map +1 -0
- package/dist/core/wgsl/majorant.d.ts +62 -0
- package/dist/core/wgsl/majorant.js +381 -0
- package/dist/core/wgsl/majorant.js.map +1 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +14 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.js +333 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -0
- package/dist/core/wgsl/reserved.d.ts +9 -0
- package/dist/core/wgsl/reserved.js +26 -0
- package/dist/core/wgsl/reserved.js.map +1 -0
- package/dist/core/wgsl/types.d.ts +198 -0
- package/dist/core/wgsl/types.js +2 -0
- package/dist/core/wgsl/types.js.map +1 -0
- package/dist/three/coarse-first.d.ts +207 -0
- package/dist/three/coarse-first.js +205 -0
- package/dist/three/coarse-first.js.map +1 -0
- package/dist/three/compute.d.ts +73 -0
- package/dist/three/compute.js +66 -0
- package/dist/three/compute.js.map +1 -0
- package/dist/three/device.d.ts +66 -0
- package/dist/three/device.js +62 -0
- package/dist/three/device.js.map +1 -0
- package/dist/three/frame/core-environment.d.ts +38 -0
- package/dist/three/frame/core-environment.js +154 -0
- package/dist/three/frame/core-environment.js.map +1 -0
- package/dist/three/frame/core-integrate-material.d.ts +34 -0
- package/dist/three/frame/core-integrate-material.js +162 -0
- package/dist/three/frame/core-integrate-material.js.map +1 -0
- package/dist/three/frame/core-occluders.d.ts +53 -0
- package/dist/three/frame/core-occluders.js +193 -0
- package/dist/three/frame/core-occluders.js.map +1 -0
- package/dist/three/frame/core-structs.d.ts +34 -0
- package/dist/three/frame/core-structs.js +61 -0
- package/dist/three/frame/core-structs.js.map +1 -0
- package/dist/three/frame/core-textures.d.ts +41 -0
- package/dist/three/frame/core-textures.js +114 -0
- package/dist/three/frame/core-textures.js.map +1 -0
- package/dist/three/frame/emission-light.d.ts +117 -0
- package/dist/three/frame/emission-light.js +276 -0
- package/dist/three/frame/emission-light.js.map +1 -0
- package/dist/three/frame/index.d.ts +19 -0
- package/dist/three/frame/index.js +15 -0
- package/dist/three/frame/index.js.map +1 -0
- package/dist/three/frame/medium.d.ts +33 -0
- package/dist/three/frame/medium.js +29 -0
- package/dist/three/frame/medium.js.map +1 -0
- package/dist/three/frame/renderer.d.ts +97 -0
- package/dist/three/frame/renderer.js +480 -0
- package/dist/three/frame/renderer.js.map +1 -0
- package/dist/three/frame/spectrum.d.ts +4 -0
- package/dist/three/frame/spectrum.js +15 -0
- package/dist/three/frame/spectrum.js.map +1 -0
- package/dist/three/frame/three-internals.d.ts +60 -0
- package/dist/three/frame/three-internals.js +152 -0
- package/dist/three/frame/three-internals.js.map +1 -0
- package/dist/three/frame/volume-shadows.d.ts +139 -0
- package/dist/three/frame/volume-shadows.js +403 -0
- package/dist/three/frame/volume-shadows.js.map +1 -0
- package/dist/three/frame/volume.d.ts +230 -0
- package/dist/three/frame/volume.js +268 -0
- package/dist/three/frame/volume.js.map +1 -0
- package/dist/three/grid-node.d.ts +229 -0
- package/dist/three/grid-node.js +545 -0
- package/dist/three/grid-node.js.map +1 -0
- package/dist/three/index.d.ts +52 -0
- package/dist/three/index.js +58 -0
- package/dist/three/index.js.map +1 -0
- package/dist/three/internal.d.ts +20 -0
- package/dist/three/internal.js +18 -0
- package/dist/three/internal.js.map +1 -0
- package/dist/three/level-set-material.d.ts +185 -0
- package/dist/three/level-set-material.js +241 -0
- package/dist/three/level-set-material.js.map +1 -0
- package/dist/three/level-set-physical-material.d.ts +154 -0
- package/dist/three/level-set-physical-material.js +253 -0
- package/dist/three/level-set-physical-material.js.map +1 -0
- package/dist/three/level-set-velocity.d.ts +94 -0
- package/dist/three/level-set-velocity.js +208 -0
- package/dist/three/level-set-velocity.js.map +1 -0
- package/dist/three/material.d.ts +324 -0
- package/dist/three/material.js +502 -0
- package/dist/three/material.js.map +1 -0
- package/dist/three/points.d.ts +140 -0
- package/dist/three/points.js +261 -0
- package/dist/three/points.js.map +1 -0
- package/dist/three/sparse-source.d.ts +165 -0
- package/dist/three/sparse-source.js +405 -0
- package/dist/three/sparse-source.js.map +1 -0
- package/dist/three/volume-source.d.ts +22 -0
- package/dist/three/volume-source.js +110 -0
- package/dist/three/volume-source.js.map +1 -0
- package/dist/tools/cpu/brick-atlas.d.ts +36 -0
- package/dist/tools/cpu/brick-atlas.js +129 -0
- package/dist/tools/cpu/brick-atlas.js.map +1 -0
- package/dist/tools/cpu/compute.d.ts +116 -0
- package/dist/tools/cpu/compute.js +239 -0
- package/dist/tools/cpu/compute.js.map +1 -0
- package/dist/tools/cpu/lean-reads.d.ts +81 -0
- package/dist/tools/cpu/lean-reads.js +262 -0
- package/dist/tools/cpu/lean-reads.js.map +1 -0
- package/dist/tools/cpu/level-set.d.ts +111 -0
- package/dist/tools/cpu/level-set.js +313 -0
- package/dist/tools/cpu/level-set.js.map +1 -0
- package/dist/tools/cpu/majorant.d.ts +265 -0
- package/dist/tools/cpu/majorant.js +541 -0
- package/dist/tools/cpu/majorant.js.map +1 -0
- package/dist/tools/cpu/march.d.ts +297 -0
- package/dist/tools/cpu/march.js +726 -0
- package/dist/tools/cpu/march.js.map +1 -0
- package/dist/tools/cpu/mesh-decimate.d.ts +124 -0
- package/dist/tools/cpu/mesh-decimate.js +1225 -0
- package/dist/tools/cpu/mesh-decimate.js.map +1 -0
- package/dist/tools/cpu/points.d.ts +29 -0
- package/dist/tools/cpu/points.js +38 -0
- package/dist/tools/cpu/points.js.map +1 -0
- package/dist/tools/cpu/probe-coords.d.ts +70 -0
- package/dist/tools/cpu/probe-coords.js +116 -0
- package/dist/tools/cpu/probe-coords.js.map +1 -0
- package/dist/tools/cpu/read-value.d.ts +44 -0
- package/dist/tools/cpu/read-value.js +351 -0
- package/dist/tools/cpu/read-value.js.map +1 -0
- package/dist/tools/cpu/sample-trilinear.d.ts +43 -0
- package/dist/tools/cpu/sample-trilinear.js +168 -0
- package/dist/tools/cpu/sample-trilinear.js.map +1 -0
- package/dist/tools/cpu/stride-tables.d.ts +56 -0
- package/dist/tools/cpu/stride-tables.generated.d.ts +1059 -0
- package/dist/tools/cpu/stride-tables.generated.js +1267 -0
- package/dist/tools/cpu/stride-tables.generated.js.map +1 -0
- package/dist/tools/cpu/stride-tables.js +78 -0
- package/dist/tools/cpu/stride-tables.js.map +1 -0
- package/dist/tools/cpu/surface-nets.d.ts +90 -0
- package/dist/tools/cpu/surface-nets.js +597 -0
- package/dist/tools/cpu/surface-nets.js.map +1 -0
- package/dist/tools/errors.d.ts +66 -0
- package/dist/tools/errors.js +67 -0
- package/dist/tools/errors.js.map +1 -0
- package/dist/tools/frame/ambient.d.ts +98 -0
- package/dist/tools/frame/ambient.js +274 -0
- package/dist/tools/frame/ambient.js.map +1 -0
- package/dist/tools/frame/blackbody.d.ts +57 -0
- package/dist/tools/frame/blackbody.js +151 -0
- package/dist/tools/frame/blackbody.js.map +1 -0
- package/dist/tools/frame/brick-cache.d.ts +165 -0
- package/dist/tools/frame/brick-cache.js +326 -0
- package/dist/tools/frame/brick-cache.js.map +1 -0
- package/dist/tools/frame/emission.d.ts +137 -0
- package/dist/tools/frame/emission.js +290 -0
- package/dist/tools/frame/emission.js.map +1 -0
- package/dist/tools/frame/environment-gpu.d.ts +111 -0
- package/dist/tools/frame/environment-gpu.js +280 -0
- package/dist/tools/frame/environment-gpu.js.map +1 -0
- package/dist/tools/frame/environment.d.ts +106 -0
- package/dist/tools/frame/environment.js +272 -0
- package/dist/tools/frame/environment.js.map +1 -0
- package/dist/tools/frame/froxel.d.ts +58 -0
- package/dist/tools/frame/froxel.js +115 -0
- package/dist/tools/frame/froxel.js.map +1 -0
- package/dist/tools/frame/grid.d.ts +392 -0
- package/dist/tools/frame/grid.js +802 -0
- package/dist/tools/frame/grid.js.map +1 -0
- package/dist/tools/frame/index.d.ts +150 -0
- package/dist/tools/frame/index.js +389 -0
- package/dist/tools/frame/index.js.map +1 -0
- package/dist/tools/frame/medium.d.ts +77 -0
- package/dist/tools/frame/medium.js +101 -0
- package/dist/tools/frame/medium.js.map +1 -0
- package/dist/tools/frame/mie-table.d.ts +6 -0
- package/dist/tools/frame/mie-table.js +16 -0
- package/dist/tools/frame/mie-table.js.map +1 -0
- package/dist/tools/frame/mie.d.ts +63 -0
- package/dist/tools/frame/mie.js +194 -0
- package/dist/tools/frame/mie.js.map +1 -0
- package/dist/tools/frame/mlp-nn.d.ts +36 -0
- package/dist/tools/frame/mlp-nn.js +159 -0
- package/dist/tools/frame/mlp-nn.js.map +1 -0
- package/dist/tools/frame/mlp-tza.d.ts +29 -0
- package/dist/tools/frame/mlp-tza.js +186 -0
- package/dist/tools/frame/mlp-tza.js.map +1 -0
- package/dist/tools/frame/mlp.d.ts +183 -0
- package/dist/tools/frame/mlp.js +434 -0
- package/dist/tools/frame/mlp.js.map +1 -0
- package/dist/tools/frame/ms-exit.d.ts +42 -0
- package/dist/tools/frame/ms-exit.js +90 -0
- package/dist/tools/frame/ms-exit.js.map +1 -0
- package/dist/tools/frame/multi-scale.d.ts +152 -0
- package/dist/tools/frame/multi-scale.js +302 -0
- package/dist/tools/frame/multi-scale.js.map +1 -0
- package/dist/tools/frame/neural-weights.d.ts +10 -0
- package/dist/tools/frame/neural-weights.js +244 -0
- package/dist/tools/frame/neural-weights.js.map +1 -0
- package/dist/tools/frame/neural.d.ts +80 -0
- package/dist/tools/frame/neural.js +150 -0
- package/dist/tools/frame/neural.js.map +1 -0
- package/dist/tools/frame/occluders.d.ts +51 -0
- package/dist/tools/frame/occluders.js +72 -0
- package/dist/tools/frame/occluders.js.map +1 -0
- package/dist/tools/frame/pyramid-layout.d.ts +55 -0
- package/dist/tools/frame/pyramid-layout.js +100 -0
- package/dist/tools/frame/pyramid-layout.js.map +1 -0
- package/dist/tools/frame/shadows.d.ts +190 -0
- package/dist/tools/frame/shadows.js +468 -0
- package/dist/tools/frame/shadows.js.map +1 -0
- package/dist/tools/frame/sparse.d.ts +147 -0
- package/dist/tools/frame/sparse.js +432 -0
- package/dist/tools/frame/sparse.js.map +1 -0
- package/dist/tools/frame/spectral-stack.d.ts +159 -0
- package/dist/tools/frame/spectral-stack.js +391 -0
- package/dist/tools/frame/spectral-stack.js.map +1 -0
- package/dist/tools/frame/spectral.d.ts +222 -0
- package/dist/tools/frame/spectral.js +572 -0
- package/dist/tools/frame/spectral.js.map +1 -0
- package/dist/tools/frame/stack.d.ts +115 -0
- package/dist/tools/frame/stack.js +290 -0
- package/dist/tools/frame/stack.js.map +1 -0
- package/dist/tools/frame/view.d.ts +131 -0
- package/dist/tools/frame/view.js +337 -0
- package/dist/tools/frame/view.js.map +1 -0
- package/dist/tools/index.d.ts +157 -0
- package/dist/tools/index.js +132 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/internal.d.ts +87 -0
- package/dist/tools/internal.js +85 -0
- package/dist/tools/internal.js.map +1 -0
- package/dist/tools/nanovdb/build-from-vdb.d.ts +59 -0
- package/dist/tools/nanovdb/build-from-vdb.js +100 -0
- package/dist/tools/nanovdb/build-from-vdb.js.map +1 -0
- package/dist/tools/nanovdb/bytes.d.ts +233 -0
- package/dist/tools/nanovdb/bytes.js +388 -0
- package/dist/tools/nanovdb/bytes.js.map +1 -0
- package/dist/tools/nanovdb/coarse-first.d.ts +78 -0
- package/dist/tools/nanovdb/coarse-first.js +92 -0
- package/dist/tools/nanovdb/coarse-first.js.map +1 -0
- package/dist/tools/nanovdb/half.d.ts +22 -0
- package/dist/tools/nanovdb/half.js +73 -0
- package/dist/tools/nanovdb/half.js.map +1 -0
- package/dist/tools/nanovdb/index.d.ts +34 -0
- package/dist/tools/nanovdb/index.js +25 -0
- package/dist/tools/nanovdb/index.js.map +1 -0
- package/dist/tools/nanovdb/inspect.d.ts +33 -0
- package/dist/tools/nanovdb/inspect.js +70 -0
- package/dist/tools/nanovdb/inspect.js.map +1 -0
- package/dist/tools/nanovdb/leaf-codec.d.ts +119 -0
- package/dist/tools/nanovdb/leaf-codec.js +356 -0
- package/dist/tools/nanovdb/leaf-codec.js.map +1 -0
- package/dist/tools/nanovdb/quantize.d.ts +72 -0
- package/dist/tools/nanovdb/quantize.js +329 -0
- package/dist/tools/nanovdb/quantize.js.map +1 -0
- package/dist/tools/nanovdb/resample.d.ts +177 -0
- package/dist/tools/nanovdb/resample.js +692 -0
- package/dist/tools/nanovdb/resample.js.map +1 -0
- package/dist/tools/nanovdb/serialize.d.ts +176 -0
- package/dist/tools/nanovdb/serialize.js +439 -0
- package/dist/tools/nanovdb/serialize.js.map +1 -0
- package/dist/tools/nanovdb/stats.d.ts +87 -0
- package/dist/tools/nanovdb/stats.js +225 -0
- package/dist/tools/nanovdb/stats.js.map +1 -0
- package/dist/tools/nanovdb/transform.d.ts +30 -0
- package/dist/tools/nanovdb/transform.js +94 -0
- package/dist/tools/nanovdb/transform.js.map +1 -0
- package/dist/tools/nanovdb/tree.d.ts +186 -0
- package/dist/tools/nanovdb/tree.js +530 -0
- package/dist/tools/nanovdb/tree.js.map +1 -0
- package/dist/tools/nanovdb/write-nvdb.d.ts +74 -0
- package/dist/tools/nanovdb/write-nvdb.js +290 -0
- package/dist/tools/nanovdb/write-nvdb.js.map +1 -0
- package/dist/tools/nvdb-file.d.ts +265 -0
- package/dist/tools/nvdb-file.js +763 -0
- package/dist/tools/nvdb-file.js.map +1 -0
- package/dist/tools/nvdb-stream.d.ts +154 -0
- package/dist/tools/nvdb-stream.js +409 -0
- package/dist/tools/nvdb-stream.js.map +1 -0
- package/dist/tools/reference/analytic.d.ts +41 -0
- package/dist/tools/reference/analytic.js +95 -0
- package/dist/tools/reference/analytic.js.map +1 -0
- package/dist/tools/reference/environment.d.ts +62 -0
- package/dist/tools/reference/environment.js +154 -0
- package/dist/tools/reference/environment.js.map +1 -0
- package/dist/tools/reference/index.d.ts +12 -0
- package/dist/tools/reference/index.js +13 -0
- package/dist/tools/reference/index.js.map +1 -0
- package/dist/tools/reference/media.d.ts +14 -0
- package/dist/tools/reference/media.js +30 -0
- package/dist/tools/reference/media.js.map +1 -0
- package/dist/tools/reference/rng.d.ts +20 -0
- package/dist/tools/reference/rng.js +30 -0
- package/dist/tools/reference/rng.js.map +1 -0
- package/dist/tools/reference/scene.d.ts +312 -0
- package/dist/tools/reference/scene.js +169 -0
- package/dist/tools/reference/scene.js.map +1 -0
- package/dist/tools/reference/tables.d.ts +98 -0
- package/dist/tools/reference/tables.js +264 -0
- package/dist/tools/reference/tables.js.map +1 -0
- package/dist/tools/reference/trace.d.ts +160 -0
- package/dist/tools/reference/trace.js +497 -0
- package/dist/tools/reference/trace.js.map +1 -0
- package/dist/tools/vdb/bit-utils.d.ts +20 -0
- package/dist/tools/vdb/bit-utils.js +42 -0
- package/dist/tools/vdb/bit-utils.js.map +1 -0
- package/dist/tools/vdb/blosc-write.d.ts +43 -0
- package/dist/tools/vdb/blosc-write.js +197 -0
- package/dist/tools/vdb/blosc-write.js.map +1 -0
- package/dist/tools/vdb/blosc.d.ts +86 -0
- package/dist/tools/vdb/blosc.js +287 -0
- package/dist/tools/vdb/blosc.js.map +1 -0
- package/dist/tools/vdb/blosclz.d.ts +33 -0
- package/dist/tools/vdb/blosclz.js +112 -0
- package/dist/tools/vdb/blosclz.js.map +1 -0
- package/dist/tools/vdb/byte-reader.d.ts +50 -0
- package/dist/tools/vdb/byte-reader.js +161 -0
- package/dist/tools/vdb/byte-reader.js.map +1 -0
- package/dist/tools/vdb/compression.d.ts +81 -0
- package/dist/tools/vdb/compression.js +260 -0
- package/dist/tools/vdb/compression.js.map +1 -0
- package/dist/tools/vdb/errors.d.ts +10 -0
- package/dist/tools/vdb/errors.js +11 -0
- package/dist/tools/vdb/errors.js.map +1 -0
- package/dist/tools/vdb/grid.d.ts +37 -0
- package/dist/tools/vdb/grid.js +153 -0
- package/dist/tools/vdb/grid.js.map +1 -0
- package/dist/tools/vdb/half-float.d.ts +9 -0
- package/dist/tools/vdb/half-float.js +24 -0
- package/dist/tools/vdb/half-float.js.map +1 -0
- package/dist/tools/vdb/index.d.ts +4 -0
- package/dist/tools/vdb/index.js +3 -0
- package/dist/tools/vdb/index.js.map +1 -0
- package/dist/tools/vdb/inflate.d.ts +24 -0
- package/dist/tools/vdb/inflate.js +334 -0
- package/dist/tools/vdb/inflate.js.map +1 -0
- package/dist/tools/vdb/lz4.d.ts +30 -0
- package/dist/tools/vdb/lz4.js +228 -0
- package/dist/tools/vdb/lz4.js.map +1 -0
- package/dist/tools/vdb/metadata.d.ts +17 -0
- package/dist/tools/vdb/metadata.js +72 -0
- package/dist/tools/vdb/metadata.js.map +1 -0
- package/dist/tools/vdb/parse.d.ts +47 -0
- package/dist/tools/vdb/parse.js +241 -0
- package/dist/tools/vdb/parse.js.map +1 -0
- package/dist/tools/vdb/point-render-data.d.ts +79 -0
- package/dist/tools/vdb/point-render-data.js +137 -0
- package/dist/tools/vdb/point-render-data.js.map +1 -0
- package/dist/tools/vdb/points.d.ts +186 -0
- package/dist/tools/vdb/points.js +835 -0
- package/dist/tools/vdb/points.js.map +1 -0
- package/dist/tools/vdb/transform.d.ts +23 -0
- package/dist/tools/vdb/transform.js +54 -0
- package/dist/tools/vdb/transform.js.map +1 -0
- package/dist/tools/vdb/tree.d.ts +111 -0
- package/dist/tools/vdb/tree.js +228 -0
- package/dist/tools/vdb/tree.js.map +1 -0
- package/dist/tools/vdb/types.d.ts +195 -0
- package/dist/tools/vdb/types.js +3 -0
- package/dist/tools/vdb/types.js.map +1 -0
- package/dist/tools/wvdb/bake.d.ts +145 -0
- package/dist/tools/wvdb/bake.js +361 -0
- package/dist/tools/wvdb/bake.js.map +1 -0
- package/dist/tools/wvdb/dense.d.ts +191 -0
- package/dist/tools/wvdb/dense.js +368 -0
- package/dist/tools/wvdb/dense.js.map +1 -0
- package/dist/tools/wvdb/format.d.ts +220 -0
- package/dist/tools/wvdb/format.js +306 -0
- package/dist/tools/wvdb/format.js.map +1 -0
- package/dist/tools/wvdb/index.d.ts +14 -0
- package/dist/tools/wvdb/index.js +15 -0
- package/dist/tools/wvdb/index.js.map +1 -0
- package/dist/tools/wvdb/level-set.d.ts +56 -0
- package/dist/tools/wvdb/level-set.js +153 -0
- package/dist/tools/wvdb/level-set.js.map +1 -0
- package/dist/tools/wvdb/nanovdb.d.ts +59 -0
- package/dist/tools/wvdb/nanovdb.js +64 -0
- package/dist/tools/wvdb/nanovdb.js.map +1 -0
- package/dist/tools/wvdb/partial.d.ts +74 -0
- package/dist/tools/wvdb/partial.js +233 -0
- package/dist/tools/wvdb/partial.js.map +1 -0
- package/dist/tools/wvdb/read.d.ts +336 -0
- package/dist/tools/wvdb/read.js +766 -0
- package/dist/tools/wvdb/read.js.map +1 -0
- package/dist/tools/wvdb/sha256.d.ts +7 -0
- package/dist/tools/wvdb/sha256.js +76 -0
- package/dist/tools/wvdb/sha256.js.map +1 -0
- package/dist/tools/wvdb/write.d.ts +149 -0
- package/dist/tools/wvdb/write.js +403 -0
- package/dist/tools/wvdb/write.js.map +1 -0
- package/package.json +83 -4
- package/vendor/LICENSE +201 -0
- package/vendor/NOTICE +19 -0
- package/vendor/VENDOR.md +100 -0
- package/vendor/pnanovdb.wgsl +1577 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* format.ts — `.wvdb` (WebVDB, mjurczyk's spec v0.5.x) constants, header types
|
|
3
|
+
* and the chunk codecs: page, mask and points chunks (spec §3.3, §6, §7).
|
|
4
|
+
*
|
|
5
|
+
* Portions derived from mjurczyk/openvdb (MIT), commit 75e7345:
|
|
6
|
+
* `src/openvdb/wvdb/format.js` (encodeWVDBPage / decodeWVDBPage /
|
|
7
|
+
* encodeWVDBMask / encodeWVDBPoints / decodeWVDBPoints). Written from the spec
|
|
8
|
+
* (`src/docs/wvdb/README.md` at that commit); where the spec leaves a choice,
|
|
9
|
+
* these follow his code so our bytes and decoded values match his:
|
|
10
|
+
* - min/max of a brick channel are taken over float32 values in float64 and
|
|
11
|
+
* then `Math.fround`ed; `scale = maxCode / (max - min)` in float64.
|
|
12
|
+
* - `Math.round` (halves toward +infinity) for every code, as the spec says.
|
|
13
|
+
* - decode computes `min + code * ((max - min) / maxCode)` in float64 and
|
|
14
|
+
* stores the float32 result; the end codes return min and max exactly.
|
|
15
|
+
* - a point colour that is not finite encodes as 1.0 (his encoder; the spec
|
|
16
|
+
* is silent on NaN).
|
|
17
|
+
*
|
|
18
|
+
* No `three`, no `node:` imports: Node and browser.
|
|
19
|
+
*/
|
|
20
|
+
import { WvdbFormatError } from "../errors.js";
|
|
21
|
+
/** ASCII `WVDB`. */
|
|
22
|
+
export declare const WVDB_MAGIC = "WVDB";
|
|
23
|
+
/** Magic + version + headerLength. */
|
|
24
|
+
export declare const WVDB_PREAMBLE_SIZE = 12;
|
|
25
|
+
/** Versions this reader understands (spec §11). Writers use 1 without points grids, 2 with. */
|
|
26
|
+
export declare const WVDB_SUPPORTED_VERSIONS: readonly [1, 2];
|
|
27
|
+
/** First version with points grids. */
|
|
28
|
+
export declare const WVDB_POINTS_VERSION = 2;
|
|
29
|
+
/** Voxels per brick edge (spec §3.3). */
|
|
30
|
+
export declare const WVDB_BRICK_DIM = 8;
|
|
31
|
+
/** Voxels per brick: `WVDB_BRICK_DIM` cubed. */
|
|
32
|
+
export declare const WVDB_BRICK_VOXELS = 512;
|
|
33
|
+
/** Points of one points page chunk, as his writer chooses (`1 << 18`). */
|
|
34
|
+
export declare const WVDB_POINTS_PAGE: number;
|
|
35
|
+
/** Three numbers: a dimension triple, a position or an RGB value. */
|
|
36
|
+
export type WvdbVec3 = [number, number, number];
|
|
37
|
+
/** `[[minX, minY, minZ], [maxX, maxY, maxZ]]` in world units. */
|
|
38
|
+
export type WvdbBox = [WvdbVec3, WvdbVec3];
|
|
39
|
+
/** How a LOD stores its bricks: every brick (`dense`) or only the non-empty ones, listed by a mask (`sparse`). */
|
|
40
|
+
export type WvdbLayout = "dense" | "sparse";
|
|
41
|
+
/** Bits per stored density sample: 8 or 16 (spec §3). */
|
|
42
|
+
export type WvdbBits = 8 | 16;
|
|
43
|
+
/** Grid classes the spec names; any other string reads as `"unknown"` (spec §5.4). */
|
|
44
|
+
export type WvdbGridClass = "fog volume" | "level set" | "staggered" | "unknown";
|
|
45
|
+
/** A byte range of the file's data section (the compressed chunk of one page or mask). */
|
|
46
|
+
export interface WvdbChunkRef {
|
|
47
|
+
/** Byte offset from the start of the data section. */
|
|
48
|
+
offset: number;
|
|
49
|
+
/** Byte length of the chunk. */
|
|
50
|
+
length: number;
|
|
51
|
+
}
|
|
52
|
+
/** A page of a volume LOD: a chunk that holds up to `bake.pageBricks` bricks. */
|
|
53
|
+
export interface WvdbPageRef extends WvdbChunkRef {
|
|
54
|
+
/** Bricks in this page. */
|
|
55
|
+
bricks: number;
|
|
56
|
+
}
|
|
57
|
+
/** A page of a points LOD: a chunk that holds up to `WVDB_POINTS_PAGE` points. */
|
|
58
|
+
export interface WvdbPointsPageRef extends WvdbChunkRef {
|
|
59
|
+
/** Points in this page. */
|
|
60
|
+
points: number;
|
|
61
|
+
}
|
|
62
|
+
/** The header record of one LOD of a volume grid. */
|
|
63
|
+
export interface WvdbVolumeLodHeader {
|
|
64
|
+
/** Voxels per axis at this LOD. */
|
|
65
|
+
dimensions: WvdbVec3;
|
|
66
|
+
/** Bricks stored (all of them for the dense layout, the non-empty ones for the sparse layout). */
|
|
67
|
+
bricks: number;
|
|
68
|
+
/** Present iff the LOD has the sparse layout. */
|
|
69
|
+
mask?: WvdbChunkRef;
|
|
70
|
+
/** The brick pages, in order. */
|
|
71
|
+
pages: WvdbPageRef[];
|
|
72
|
+
}
|
|
73
|
+
/** The header record of a volume grid. */
|
|
74
|
+
export interface WvdbVolumeGridHeader {
|
|
75
|
+
/** The OpenVDB grid name. */
|
|
76
|
+
name: string;
|
|
77
|
+
/** `"volume"`; absent in version 1 files. */
|
|
78
|
+
type?: "volume";
|
|
79
|
+
/** The OpenVDB grid class as a string (see {@link WvdbGridClass}). */
|
|
80
|
+
class: string;
|
|
81
|
+
/** Channels per voxel: 1 (scalar) or 3 (vector). Default 1. */
|
|
82
|
+
channels?: 1 | 3;
|
|
83
|
+
/** The value of voxels outside the grid, a number or an RGB triple. */
|
|
84
|
+
background: number | WvdbVec3;
|
|
85
|
+
/** The grid's active-voxel box in world units, or null when it has none. */
|
|
86
|
+
bbox: WvdbBox | null;
|
|
87
|
+
/** Mean density over the baked box, when the baker recorded it. */
|
|
88
|
+
meanDensity?: number;
|
|
89
|
+
/** Count of voxels with a non-zero density, when the baker recorded it. */
|
|
90
|
+
nonZeroVoxels?: number;
|
|
91
|
+
/** The LODs, coarse first (LOD `bake.lods - 1` is the finest). */
|
|
92
|
+
lods: WvdbVolumeLodHeader[];
|
|
93
|
+
}
|
|
94
|
+
/** The header record of one LOD of a points grid. */
|
|
95
|
+
export interface WvdbPointsLodHeader {
|
|
96
|
+
/** Points stored in this LOD's pages (the ones it adds to the coarser LODs). */
|
|
97
|
+
points: number;
|
|
98
|
+
/** The point pages, in order. */
|
|
99
|
+
pages: WvdbPointsPageRef[];
|
|
100
|
+
}
|
|
101
|
+
/** The header record of a points grid (version 2). */
|
|
102
|
+
export interface WvdbPointsGridHeader {
|
|
103
|
+
/** The OpenVDB grid name. */
|
|
104
|
+
name: string;
|
|
105
|
+
/** Always `"points"`. */
|
|
106
|
+
type: "points";
|
|
107
|
+
/** The OpenVDB grid class as a string. */
|
|
108
|
+
class: string;
|
|
109
|
+
/** Points in the grid, all LODs together. */
|
|
110
|
+
count: number;
|
|
111
|
+
/** Points in the source grid before `bake.maxPoints` thinned them. */
|
|
112
|
+
sourceCount?: number;
|
|
113
|
+
/** Mean point spacing in world units. */
|
|
114
|
+
spacing?: number;
|
|
115
|
+
/** True when each point carries an RGB colour. */
|
|
116
|
+
colors: boolean;
|
|
117
|
+
/** The points' box in world units, or null for an empty grid. */
|
|
118
|
+
bbox: WvdbBox | null;
|
|
119
|
+
/** The LODs, coarse first (LOD `bake.lods - 1` is the finest). */
|
|
120
|
+
lods: WvdbPointsLodHeader[];
|
|
121
|
+
}
|
|
122
|
+
/** A grid's header record: a volume or a points grid (tell them apart with {@link isPointsGridHeader}). */
|
|
123
|
+
export type WvdbGridHeader = WvdbVolumeGridHeader | WvdbPointsGridHeader;
|
|
124
|
+
/** The settings a file was baked with (spec §5.2). */
|
|
125
|
+
export interface WvdbBake {
|
|
126
|
+
/** Names of the grids baked, or null for every grid in the source. */
|
|
127
|
+
grids: string[] | null;
|
|
128
|
+
/** Voxels along the longest axis of the finest LOD. */
|
|
129
|
+
resolution: number;
|
|
130
|
+
/** Number of LODs baked. */
|
|
131
|
+
lods: number;
|
|
132
|
+
/** Bits per density sample. */
|
|
133
|
+
bits: WvdbBits;
|
|
134
|
+
/** Brick layout of the volume LODs. */
|
|
135
|
+
layout: WvdbLayout;
|
|
136
|
+
/** Bricks per page. */
|
|
137
|
+
pageBricks: number;
|
|
138
|
+
/** The box that was baked, in world units, or null for the grid's own box. */
|
|
139
|
+
bbox?: WvdbBox | null;
|
|
140
|
+
/** Cap on the points kept per points grid. */
|
|
141
|
+
maxPoints?: number;
|
|
142
|
+
}
|
|
143
|
+
/** The file a `.wvdb` was baked from. */
|
|
144
|
+
export interface WvdbSource {
|
|
145
|
+
/** The source file's name. */
|
|
146
|
+
file: string;
|
|
147
|
+
/** SHA-256 of the source file, hex. */
|
|
148
|
+
sha256: string;
|
|
149
|
+
}
|
|
150
|
+
/** The JSON header of a `.wvdb` file (spec §5). */
|
|
151
|
+
export interface WvdbHeader {
|
|
152
|
+
/** File version: 1, or 2 when the file has points grids. */
|
|
153
|
+
version: number;
|
|
154
|
+
/** The file this one was baked from. */
|
|
155
|
+
source: WvdbSource;
|
|
156
|
+
/** The bake settings. */
|
|
157
|
+
bake: WvdbBake;
|
|
158
|
+
/** Voxels per brick edge (8). */
|
|
159
|
+
brickDim: number;
|
|
160
|
+
/** One header per grid. */
|
|
161
|
+
grids: WvdbGridHeader[];
|
|
162
|
+
}
|
|
163
|
+
/** Narrows a {@link WvdbGridHeader} to a points grid. */
|
|
164
|
+
export declare const isPointsGridHeader: (grid: WvdbGridHeader) => grid is WvdbPointsGridHeader;
|
|
165
|
+
export declare function brickCounts([x, y, z]: readonly number[]): WvdbVec3;
|
|
166
|
+
export declare function brickTotal(dimensions: readonly number[]): number;
|
|
167
|
+
/** First voxel of brick `index` (x fastest, then y, then z). */
|
|
168
|
+
export declare function brickOrigin(dimensions: readonly number[], index: number): WvdbVec3;
|
|
169
|
+
/** Appendix B: inflated page size. `varying` = brick channels with min !== max. */
|
|
170
|
+
export declare function pageByteSize(count: number, channels: number, bits: WvdbBits, sparse: boolean, varying: number): number;
|
|
171
|
+
/** Appendix B: inflated points chunk size. */
|
|
172
|
+
export declare function pointsChunkByteSize(count: number, colors: boolean): number;
|
|
173
|
+
/** §6.3: inflated mask size. */
|
|
174
|
+
export declare function maskByteSize(total: number): number;
|
|
175
|
+
/** One brick for the encoder: `values` holds 512 values per channel, one channel after the other. */
|
|
176
|
+
export interface WvdbBrickInput {
|
|
177
|
+
index: number;
|
|
178
|
+
values: Float32Array;
|
|
179
|
+
}
|
|
180
|
+
export declare function encodePage(bricks: readonly WvdbBrickInput[], { layout, bits, channels }: {
|
|
181
|
+
layout: WvdbLayout;
|
|
182
|
+
bits: WvdbBits;
|
|
183
|
+
channels: number;
|
|
184
|
+
}): Uint8Array;
|
|
185
|
+
export interface DecodedPage {
|
|
186
|
+
/** Brick indices, in page order. */
|
|
187
|
+
indices: Uint32Array;
|
|
188
|
+
/** Brick channel ranges, `b * channels + c`. */
|
|
189
|
+
mins: Float32Array;
|
|
190
|
+
maxs: Float32Array;
|
|
191
|
+
/** 512 decoded values per brick channel, in brick channel order (brick 0 channel 0, brick 0 channel 1, ...). */
|
|
192
|
+
values: Float32Array;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Decodes one inflated page and validates its size exactly (Appendix B,
|
|
196
|
+
* §14). `firstIndex` gives the implicit indices of a dense page.
|
|
197
|
+
*/
|
|
198
|
+
export declare function decodePage(bytes: Uint8Array, opts: {
|
|
199
|
+
layout: WvdbLayout;
|
|
200
|
+
bits: WvdbBits;
|
|
201
|
+
channels: number;
|
|
202
|
+
count: number;
|
|
203
|
+
firstIndex: number;
|
|
204
|
+
brickTotal: number;
|
|
205
|
+
}): DecodedPage;
|
|
206
|
+
export declare function encodeMask(indices: Iterable<number>, total: number): Uint8Array;
|
|
207
|
+
export declare function decodeMask(bytes: Uint8Array, total: number): Uint32Array;
|
|
208
|
+
export declare const isMaskBitSet: (words: Uint32Array, index: number) => boolean;
|
|
209
|
+
/** `positions`: xyz per point. `colors`: rgb per point in [0, 1], or null. */
|
|
210
|
+
export declare function encodePoints(positions: Float32Array, colors: Float32Array | null): Uint8Array;
|
|
211
|
+
export interface DecodedPoints {
|
|
212
|
+
positions: Float32Array;
|
|
213
|
+
colors: Float32Array | null;
|
|
214
|
+
}
|
|
215
|
+
export declare function decodePoints(bytes: Uint8Array, { count, colors }: {
|
|
216
|
+
count: number;
|
|
217
|
+
colors: boolean;
|
|
218
|
+
}): DecodedPoints;
|
|
219
|
+
/** A `.wvdb` file breaks the spec (bad magic, header, offsets, sizes); defined in `../errors.ts` (D32). */
|
|
220
|
+
export { WvdbFormatError };
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* format.ts — `.wvdb` (WebVDB, mjurczyk's spec v0.5.x) constants, header types
|
|
3
|
+
* and the chunk codecs: page, mask and points chunks (spec §3.3, §6, §7).
|
|
4
|
+
*
|
|
5
|
+
* Portions derived from mjurczyk/openvdb (MIT), commit 75e7345:
|
|
6
|
+
* `src/openvdb/wvdb/format.js` (encodeWVDBPage / decodeWVDBPage /
|
|
7
|
+
* encodeWVDBMask / encodeWVDBPoints / decodeWVDBPoints). Written from the spec
|
|
8
|
+
* (`src/docs/wvdb/README.md` at that commit); where the spec leaves a choice,
|
|
9
|
+
* these follow his code so our bytes and decoded values match his:
|
|
10
|
+
* - min/max of a brick channel are taken over float32 values in float64 and
|
|
11
|
+
* then `Math.fround`ed; `scale = maxCode / (max - min)` in float64.
|
|
12
|
+
* - `Math.round` (halves toward +infinity) for every code, as the spec says.
|
|
13
|
+
* - decode computes `min + code * ((max - min) / maxCode)` in float64 and
|
|
14
|
+
* stores the float32 result; the end codes return min and max exactly.
|
|
15
|
+
* - a point colour that is not finite encodes as 1.0 (his encoder; the spec
|
|
16
|
+
* is silent on NaN).
|
|
17
|
+
*
|
|
18
|
+
* No `three`, no `node:` imports: Node and browser.
|
|
19
|
+
*/
|
|
20
|
+
import { WvdbFormatError } from "../errors.js";
|
|
21
|
+
/** ASCII `WVDB`. */
|
|
22
|
+
export const WVDB_MAGIC = "WVDB";
|
|
23
|
+
/** Magic + version + headerLength. */
|
|
24
|
+
export const WVDB_PREAMBLE_SIZE = 12;
|
|
25
|
+
/** Versions this reader understands (spec §11). Writers use 1 without points grids, 2 with. */
|
|
26
|
+
export const WVDB_SUPPORTED_VERSIONS = [1, 2];
|
|
27
|
+
/** First version with points grids. */
|
|
28
|
+
export const WVDB_POINTS_VERSION = 2;
|
|
29
|
+
/** Voxels per brick edge (spec §3.3). */
|
|
30
|
+
export const WVDB_BRICK_DIM = 8;
|
|
31
|
+
/** Voxels per brick: `WVDB_BRICK_DIM` cubed. */
|
|
32
|
+
export const WVDB_BRICK_VOXELS = 512;
|
|
33
|
+
/** Points of one points page chunk, as his writer chooses (`1 << 18`). */
|
|
34
|
+
export const WVDB_POINTS_PAGE = 1 << 18;
|
|
35
|
+
const POINT_CODE_MAX = 0xffff;
|
|
36
|
+
/** Narrows a {@link WvdbGridHeader} to a points grid. */
|
|
37
|
+
export const isPointsGridHeader = (grid) => grid.type === "points";
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Brick math (spec §3.3)
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
export function brickCounts([x, y, z]) {
|
|
42
|
+
return [Math.ceil(x / WVDB_BRICK_DIM), Math.ceil(y / WVDB_BRICK_DIM), Math.ceil(z / WVDB_BRICK_DIM)];
|
|
43
|
+
}
|
|
44
|
+
export function brickTotal(dimensions) {
|
|
45
|
+
const [cx, cy, cz] = brickCounts(dimensions);
|
|
46
|
+
return cx * cy * cz;
|
|
47
|
+
}
|
|
48
|
+
/** First voxel of brick `index` (x fastest, then y, then z). */
|
|
49
|
+
export function brickOrigin(dimensions, index) {
|
|
50
|
+
const [countX, countY] = brickCounts(dimensions);
|
|
51
|
+
return [
|
|
52
|
+
(index % countX) * WVDB_BRICK_DIM,
|
|
53
|
+
(Math.floor(index / countX) % countY) * WVDB_BRICK_DIM,
|
|
54
|
+
Math.floor(index / (countX * countY)) * WVDB_BRICK_DIM,
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
/** Appendix B: inflated page size. `varying` = brick channels with min !== max. */
|
|
58
|
+
export function pageByteSize(count, channels, bits, sparse, varying) {
|
|
59
|
+
return 4 + (sparse ? 4 * count : 0) + 8 * count * channels + varying * WVDB_BRICK_VOXELS * (bits / 8);
|
|
60
|
+
}
|
|
61
|
+
/** Appendix B: inflated points chunk size. */
|
|
62
|
+
export function pointsChunkByteSize(count, colors) {
|
|
63
|
+
return 4 + 24 + 6 * count + (colors ? 3 * count : 0);
|
|
64
|
+
}
|
|
65
|
+
/** §6.3: inflated mask size. */
|
|
66
|
+
export function maskByteSize(total) {
|
|
67
|
+
return Math.ceil(total / 32) * 4;
|
|
68
|
+
}
|
|
69
|
+
export function encodePage(bricks, { layout, bits, channels }) {
|
|
70
|
+
const sparse = layout === "sparse";
|
|
71
|
+
const count = bricks.length;
|
|
72
|
+
const codeSize = bits / 8;
|
|
73
|
+
const maxCode = bits === 16 ? 0xffff : 0xff;
|
|
74
|
+
const ranges = count * channels;
|
|
75
|
+
const mins = new Float64Array(ranges);
|
|
76
|
+
const maxs = new Float64Array(ranges);
|
|
77
|
+
let varying = 0;
|
|
78
|
+
for (let b = 0; b < count; b++) {
|
|
79
|
+
const values = bricks[b].values;
|
|
80
|
+
for (let c = 0; c < channels; c++) {
|
|
81
|
+
let min = Infinity;
|
|
82
|
+
let max = -Infinity;
|
|
83
|
+
const end = (c + 1) * WVDB_BRICK_VOXELS;
|
|
84
|
+
for (let i = c * WVDB_BRICK_VOXELS; i < end; i++) {
|
|
85
|
+
// Math.min/max (not `<`) so -0 and 0 order exactly as in his encoder.
|
|
86
|
+
min = Math.min(min, values[i]);
|
|
87
|
+
max = Math.max(max, values[i]);
|
|
88
|
+
}
|
|
89
|
+
mins[b * channels + c] = Math.fround(min);
|
|
90
|
+
maxs[b * channels + c] = Math.fround(max);
|
|
91
|
+
if (mins[b * channels + c] !== maxs[b * channels + c])
|
|
92
|
+
varying++;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const size = pageByteSize(count, channels, bits, sparse, varying);
|
|
96
|
+
const out = new Uint8Array(size);
|
|
97
|
+
const view = new DataView(out.buffer);
|
|
98
|
+
let offset = 0;
|
|
99
|
+
view.setUint32(offset, count, true);
|
|
100
|
+
offset += 4;
|
|
101
|
+
if (sparse) {
|
|
102
|
+
for (const { index } of bricks) {
|
|
103
|
+
view.setUint32(offset, index, true);
|
|
104
|
+
offset += 4;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
for (let i = 0; i < ranges; i++, offset += 4)
|
|
108
|
+
view.setFloat32(offset, mins[i], true);
|
|
109
|
+
for (let i = 0; i < ranges; i++, offset += 4)
|
|
110
|
+
view.setFloat32(offset, maxs[i], true);
|
|
111
|
+
for (let b = 0; b < count; b++) {
|
|
112
|
+
const values = bricks[b].values;
|
|
113
|
+
for (let c = 0; c < channels; c++) {
|
|
114
|
+
const min = mins[b * channels + c];
|
|
115
|
+
const max = maxs[b * channels + c];
|
|
116
|
+
if (min === max)
|
|
117
|
+
continue;
|
|
118
|
+
const scale = maxCode / (max - min);
|
|
119
|
+
const end = (c + 1) * WVDB_BRICK_VOXELS;
|
|
120
|
+
for (let i = c * WVDB_BRICK_VOXELS; i < end; i++) {
|
|
121
|
+
const code = Math.min(Math.max(Math.round((values[i] - min) * scale), 0), maxCode);
|
|
122
|
+
if (codeSize === 2)
|
|
123
|
+
view.setUint16(offset, code, true);
|
|
124
|
+
else
|
|
125
|
+
out[offset] = code;
|
|
126
|
+
offset += codeSize;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return out;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Decodes one inflated page and validates its size exactly (Appendix B,
|
|
134
|
+
* §14). `firstIndex` gives the implicit indices of a dense page.
|
|
135
|
+
*/
|
|
136
|
+
export function decodePage(bytes, opts) {
|
|
137
|
+
const { layout, bits, channels, count, firstIndex, brickTotal: total } = opts;
|
|
138
|
+
const sparse = layout === "sparse";
|
|
139
|
+
const fixed = pageByteSize(count, channels, bits, sparse, 0);
|
|
140
|
+
if (bytes.byteLength < fixed) {
|
|
141
|
+
throw new WvdbFormatError(`page: ${bytes.byteLength} bytes, expected at least ${fixed} for ${count} bricks`);
|
|
142
|
+
}
|
|
143
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
144
|
+
const stored = view.getUint32(0, true);
|
|
145
|
+
if (stored !== count) {
|
|
146
|
+
throw new WvdbFormatError(`page: brickCount ${stored} does not match the header (${count})`);
|
|
147
|
+
}
|
|
148
|
+
let offset = 4;
|
|
149
|
+
const indices = new Uint32Array(count);
|
|
150
|
+
for (let i = 0; i < count; i++) {
|
|
151
|
+
if (sparse) {
|
|
152
|
+
indices[i] = view.getUint32(offset, true);
|
|
153
|
+
offset += 4;
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
indices[i] = firstIndex + i;
|
|
157
|
+
}
|
|
158
|
+
if (indices[i] >= total) {
|
|
159
|
+
throw new WvdbFormatError(`page: brick index ${indices[i]} is not less than brickTotal ${total}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const ranges = count * channels;
|
|
163
|
+
const mins = new Float32Array(ranges);
|
|
164
|
+
const maxs = new Float32Array(ranges);
|
|
165
|
+
for (let i = 0; i < ranges; i++, offset += 4)
|
|
166
|
+
mins[i] = view.getFloat32(offset, true);
|
|
167
|
+
for (let i = 0; i < ranges; i++, offset += 4)
|
|
168
|
+
maxs[i] = view.getFloat32(offset, true);
|
|
169
|
+
let varying = 0;
|
|
170
|
+
for (let i = 0; i < ranges; i++)
|
|
171
|
+
if (mins[i] !== maxs[i])
|
|
172
|
+
varying++;
|
|
173
|
+
const expected = pageByteSize(count, channels, bits, sparse, varying);
|
|
174
|
+
if (bytes.byteLength !== expected) {
|
|
175
|
+
throw new WvdbFormatError(`page: ${bytes.byteLength} bytes, expected ${expected} (Appendix B)`);
|
|
176
|
+
}
|
|
177
|
+
const maxCode = bits === 16 ? 0xffff : 0xff;
|
|
178
|
+
const values = new Float32Array(ranges * WVDB_BRICK_VOXELS);
|
|
179
|
+
for (let i = 0; i < ranges; i++) {
|
|
180
|
+
const min = mins[i];
|
|
181
|
+
const max = maxs[i];
|
|
182
|
+
const target = i * WVDB_BRICK_VOXELS;
|
|
183
|
+
if (min === max) {
|
|
184
|
+
values.fill(min, target, target + WVDB_BRICK_VOXELS);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const step = (max - min) / maxCode;
|
|
188
|
+
for (let v = 0; v < WVDB_BRICK_VOXELS; v++) {
|
|
189
|
+
let code;
|
|
190
|
+
if (bits === 16) {
|
|
191
|
+
code = view.getUint16(offset, true);
|
|
192
|
+
offset += 2;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
code = bytes[offset];
|
|
196
|
+
offset += 1;
|
|
197
|
+
}
|
|
198
|
+
values[target + v] = code === maxCode ? max : min + code * step;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return { indices, mins, maxs, values };
|
|
202
|
+
}
|
|
203
|
+
// ---------------------------------------------------------------------------
|
|
204
|
+
// Mask chunk (spec §6.3)
|
|
205
|
+
// ---------------------------------------------------------------------------
|
|
206
|
+
export function encodeMask(indices, total) {
|
|
207
|
+
const words = new Uint32Array(Math.ceil(total / 32));
|
|
208
|
+
for (const index of indices)
|
|
209
|
+
words[index >>> 5] |= 1 << (index & 31);
|
|
210
|
+
const out = new Uint8Array(words.length * 4);
|
|
211
|
+
const view = new DataView(out.buffer);
|
|
212
|
+
words.forEach((word, i) => view.setUint32(i * 4, word, true));
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
215
|
+
export function decodeMask(bytes, total) {
|
|
216
|
+
const expected = maskByteSize(total);
|
|
217
|
+
if (bytes.byteLength !== expected) {
|
|
218
|
+
throw new WvdbFormatError(`mask: ${bytes.byteLength} bytes, expected ${expected}`);
|
|
219
|
+
}
|
|
220
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
221
|
+
const words = new Uint32Array(expected >>> 2);
|
|
222
|
+
for (let i = 0; i < words.length; i++)
|
|
223
|
+
words[i] = view.getUint32(i * 4, true);
|
|
224
|
+
const tail = total & 31;
|
|
225
|
+
if (tail !== 0 && (words[words.length - 1] >>> tail) !== 0) {
|
|
226
|
+
throw new WvdbFormatError(`mask: bits after brick ${total - 1} are set`);
|
|
227
|
+
}
|
|
228
|
+
return words;
|
|
229
|
+
}
|
|
230
|
+
export const isMaskBitSet = (words, index) => (words[index >>> 5] & (1 << (index & 31))) !== 0;
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
// Points chunk (spec §6.4)
|
|
233
|
+
// ---------------------------------------------------------------------------
|
|
234
|
+
/** `positions`: xyz per point. `colors`: rgb per point in [0, 1], or null. */
|
|
235
|
+
export function encodePoints(positions, colors) {
|
|
236
|
+
const count = positions.length / 3;
|
|
237
|
+
const out = new Uint8Array(pointsChunkByteSize(count, !!colors));
|
|
238
|
+
const view = new DataView(out.buffer);
|
|
239
|
+
view.setUint32(0, count, true);
|
|
240
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
241
|
+
let min = Infinity;
|
|
242
|
+
let max = -Infinity;
|
|
243
|
+
for (let p = 0; p < count; p++) {
|
|
244
|
+
min = Math.min(min, positions[p * 3 + axis]);
|
|
245
|
+
max = Math.max(max, positions[p * 3 + axis]);
|
|
246
|
+
}
|
|
247
|
+
min = count > 0 ? Math.fround(min) : 0;
|
|
248
|
+
max = count > 0 ? Math.fround(max) : 0;
|
|
249
|
+
view.setFloat32(4 + axis * 4, min, true);
|
|
250
|
+
view.setFloat32(16 + axis * 4, max, true);
|
|
251
|
+
const scale = min === max ? 0 : POINT_CODE_MAX / (max - min);
|
|
252
|
+
const high = 28 + axis * 2 * count;
|
|
253
|
+
const low = high + count;
|
|
254
|
+
for (let p = 0; p < count; p++) {
|
|
255
|
+
const code = Math.min(Math.max(Math.round((positions[p * 3 + axis] - min) * scale), 0), POINT_CODE_MAX);
|
|
256
|
+
out[high + p] = code >>> 8;
|
|
257
|
+
out[low + p] = code & 0xff;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (colors) {
|
|
261
|
+
const start = 28 + 6 * count;
|
|
262
|
+
for (let c = 0; c < 3; c++) {
|
|
263
|
+
for (let p = 0; p < count; p++) {
|
|
264
|
+
const v = colors[p * 3 + c];
|
|
265
|
+
out[start + c * count + p] = Math.round(Math.min(Math.max(Number.isFinite(v) ? v : 1, 0), 1) * 255);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return out;
|
|
270
|
+
}
|
|
271
|
+
export function decodePoints(bytes, { count, colors }) {
|
|
272
|
+
const expected = pointsChunkByteSize(count, colors);
|
|
273
|
+
if (bytes.byteLength !== expected) {
|
|
274
|
+
throw new WvdbFormatError(`points: ${bytes.byteLength} bytes, expected ${expected}`);
|
|
275
|
+
}
|
|
276
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
277
|
+
const stored = view.getUint32(0, true);
|
|
278
|
+
if (stored !== count) {
|
|
279
|
+
throw new WvdbFormatError(`points: pointCount ${stored} does not match the header (${count})`);
|
|
280
|
+
}
|
|
281
|
+
const positions = new Float32Array(count * 3);
|
|
282
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
283
|
+
const min = view.getFloat32(4 + axis * 4, true);
|
|
284
|
+
const max = view.getFloat32(16 + axis * 4, true);
|
|
285
|
+
const step = (max - min) / POINT_CODE_MAX;
|
|
286
|
+
const high = 28 + axis * 2 * count;
|
|
287
|
+
const low = high + count;
|
|
288
|
+
for (let p = 0; p < count; p++) {
|
|
289
|
+
const code = (bytes[high + p] << 8) | bytes[low + p];
|
|
290
|
+
positions[p * 3 + axis] = code === POINT_CODE_MAX ? max : min + code * step;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
let rgb = null;
|
|
294
|
+
if (colors) {
|
|
295
|
+
rgb = new Float32Array(count * 3);
|
|
296
|
+
const start = 28 + 6 * count;
|
|
297
|
+
for (let c = 0; c < 3; c++) {
|
|
298
|
+
for (let p = 0; p < count; p++)
|
|
299
|
+
rgb[p * 3 + c] = bytes[start + c * count + p] / 255;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return { positions, colors: rgb };
|
|
303
|
+
}
|
|
304
|
+
/** A `.wvdb` file breaks the spec (bad magic, header, offsets, sizes); defined in `../errors.ts` (D32). */
|
|
305
|
+
export { WvdbFormatError };
|
|
306
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/tools/wvdb/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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AG,IAAI,GAAG,IAAI,CAAC;QAC9E,CAAC;IACH,CAAC;IACD,IAAI,GAAG,GAAwB,IAAI,CAAC;IACpC,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,GAAG,IAAI,YAAY,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE;gBAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAE,GAAG,GAAG,CAAC;QACvF,CAAC;IACH,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AACpC,CAAC;AAED,2GAA2G;AAC3G,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["/**\n * format.ts — `.wvdb` (WebVDB, mjurczyk's spec v0.5.x) constants, header types\n * and the chunk codecs: page, mask and points chunks (spec §3.3, §6, §7).\n *\n * Portions derived from mjurczyk/openvdb (MIT), commit 75e7345:\n * `src/openvdb/wvdb/format.js` (encodeWVDBPage / decodeWVDBPage /\n * encodeWVDBMask / encodeWVDBPoints / decodeWVDBPoints). Written from the spec\n * (`src/docs/wvdb/README.md` at that commit); where the spec leaves a choice,\n * these follow his code so our bytes and decoded values match his:\n * - min/max of a brick channel are taken over float32 values in float64 and\n * then `Math.fround`ed; `scale = maxCode / (max - min)` in float64.\n * - `Math.round` (halves toward +infinity) for every code, as the spec says.\n * - decode computes `min + code * ((max - min) / maxCode)` in float64 and\n * stores the float32 result; the end codes return min and max exactly.\n * - a point colour that is not finite encodes as 1.0 (his encoder; the spec\n * is silent on NaN).\n *\n * No `three`, no `node:` imports: Node and browser.\n */\n\nimport { WvdbFormatError } from \"../errors.js\";\n\n/** ASCII `WVDB`. */\nexport const WVDB_MAGIC = \"WVDB\";\n/** Magic + version + headerLength. */\nexport const WVDB_PREAMBLE_SIZE = 12;\n/** Versions this reader understands (spec §11). Writers use 1 without points grids, 2 with. */\nexport const WVDB_SUPPORTED_VERSIONS = [1, 2] as const;\n/** First version with points grids. */\nexport const WVDB_POINTS_VERSION = 2;\n\n/** Voxels per brick edge (spec §3.3). */\nexport const WVDB_BRICK_DIM = 8;\n/** Voxels per brick: `WVDB_BRICK_DIM` cubed. */\nexport const WVDB_BRICK_VOXELS = 512;\n/** Points of one points page chunk, as his writer chooses (`1 << 18`). */\nexport const WVDB_POINTS_PAGE = 1 << 18;\nconst POINT_CODE_MAX = 0xffff;\n\n/** Three numbers: a dimension triple, a position or an RGB value. */\nexport type WvdbVec3 = [number, number, number];\n/** `[[minX, minY, minZ], [maxX, maxY, maxZ]]` in world units. */\nexport type WvdbBox = [WvdbVec3, WvdbVec3];\n/** How a LOD stores its bricks: every brick (`dense`) or only the non-empty ones, listed by a mask (`sparse`). */\nexport type WvdbLayout = \"dense\" | \"sparse\";\n/** Bits per stored density sample: 8 or 16 (spec §3). */\nexport type WvdbBits = 8 | 16;\n/** Grid classes the spec names; any other string reads as `\"unknown\"` (spec §5.4). */\nexport type WvdbGridClass = \"fog volume\" | \"level set\" | \"staggered\" | \"unknown\";\n\n/** A byte range of the file's data section (the compressed chunk of one page or mask). */\nexport interface WvdbChunkRef {\n /** Byte offset from the start of the data section. */\n offset: number;\n /** Byte length of the chunk. */\n length: number;\n}\n/** A page of a volume LOD: a chunk that holds up to `bake.pageBricks` bricks. */\nexport interface WvdbPageRef extends WvdbChunkRef {\n /** Bricks in this page. */\n bricks: number;\n}\n/** A page of a points LOD: a chunk that holds up to `WVDB_POINTS_PAGE` points. */\nexport interface WvdbPointsPageRef extends WvdbChunkRef {\n /** Points in this page. */\n points: number;\n}\n\n/** The header record of one LOD of a volume grid. */\nexport interface WvdbVolumeLodHeader {\n /** Voxels per axis at this LOD. */\n dimensions: WvdbVec3;\n /** Bricks stored (all of them for the dense layout, the non-empty ones for the sparse layout). */\n bricks: number;\n /** Present iff the LOD has the sparse layout. */\n mask?: WvdbChunkRef;\n /** The brick pages, in order. */\n pages: WvdbPageRef[];\n}\n\n/** The header record of a volume grid. */\nexport interface WvdbVolumeGridHeader {\n /** The OpenVDB grid name. */\n name: string;\n /** `\"volume\"`; absent in version 1 files. */\n type?: \"volume\";\n /** The OpenVDB grid class as a string (see {@link WvdbGridClass}). */\n class: string;\n /** Channels per voxel: 1 (scalar) or 3 (vector). Default 1. */\n channels?: 1 | 3;\n /** The value of voxels outside the grid, a number or an RGB triple. */\n background: number | WvdbVec3;\n /** The grid's active-voxel box in world units, or null when it has none. */\n bbox: WvdbBox | null;\n /** Mean density over the baked box, when the baker recorded it. */\n meanDensity?: number;\n /** Count of voxels with a non-zero density, when the baker recorded it. */\n nonZeroVoxels?: number;\n /** The LODs, coarse first (LOD `bake.lods - 1` is the finest). */\n lods: WvdbVolumeLodHeader[];\n}\n\n/** The header record of one LOD of a points grid. */\nexport interface WvdbPointsLodHeader {\n /** Points stored in this LOD's pages (the ones it adds to the coarser LODs). */\n points: number;\n /** The point pages, in order. */\n pages: WvdbPointsPageRef[];\n}\n\n/** The header record of a points grid (version 2). */\nexport interface WvdbPointsGridHeader {\n /** The OpenVDB grid name. */\n name: string;\n /** Always `\"points\"`. */\n type: \"points\";\n /** The OpenVDB grid class as a string. */\n class: string;\n /** Points in the grid, all LODs together. */\n count: number;\n /** Points in the source grid before `bake.maxPoints` thinned them. */\n sourceCount?: number;\n /** Mean point spacing in world units. */\n spacing?: number;\n /** True when each point carries an RGB colour. */\n colors: boolean;\n /** The points' box in world units, or null for an empty grid. */\n bbox: WvdbBox | null;\n /** The LODs, coarse first (LOD `bake.lods - 1` is the finest). */\n lods: WvdbPointsLodHeader[];\n}\n\n/** A grid's header record: a volume or a points grid (tell them apart with {@link isPointsGridHeader}). */\nexport type WvdbGridHeader = WvdbVolumeGridHeader | WvdbPointsGridHeader;\n\n/** The settings a file was baked with (spec §5.2). */\nexport interface WvdbBake {\n /** Names of the grids baked, or null for every grid in the source. */\n grids: string[] | null;\n /** Voxels along the longest axis of the finest LOD. */\n resolution: number;\n /** Number of LODs baked. */\n lods: number;\n /** Bits per density sample. */\n bits: WvdbBits;\n /** Brick layout of the volume LODs. */\n layout: WvdbLayout;\n /** Bricks per page. */\n pageBricks: number;\n /** The box that was baked, in world units, or null for the grid's own box. */\n bbox?: WvdbBox | null;\n /** Cap on the points kept per points grid. */\n maxPoints?: number;\n}\n\n/** The file a `.wvdb` was baked from. */\nexport interface WvdbSource {\n /** The source file's name. */\n file: string;\n /** SHA-256 of the source file, hex. */\n sha256: string;\n}\n\n/** The JSON header of a `.wvdb` file (spec §5). */\nexport interface WvdbHeader {\n /** File version: 1, or 2 when the file has points grids. */\n version: number;\n /** The file this one was baked from. */\n source: WvdbSource;\n /** The bake settings. */\n bake: WvdbBake;\n /** Voxels per brick edge (8). */\n brickDim: number;\n /** One header per grid. */\n grids: WvdbGridHeader[];\n}\n\n/** Narrows a {@link WvdbGridHeader} to a points grid. */\nexport const isPointsGridHeader = (grid: WvdbGridHeader): grid is WvdbPointsGridHeader =>\n grid.type === \"points\";\n\n// ---------------------------------------------------------------------------\n// Brick math (spec §3.3)\n// ---------------------------------------------------------------------------\n\nexport function brickCounts([x, y, z]: readonly number[]): WvdbVec3 {\n return [Math.ceil(x! / WVDB_BRICK_DIM), Math.ceil(y! / WVDB_BRICK_DIM), Math.ceil(z! / WVDB_BRICK_DIM)];\n}\n\nexport function brickTotal(dimensions: readonly number[]): number {\n const [cx, cy, cz] = brickCounts(dimensions);\n return cx * cy * cz;\n}\n\n/** First voxel of brick `index` (x fastest, then y, then z). */\nexport function brickOrigin(dimensions: readonly number[], index: number): WvdbVec3 {\n const [countX, countY] = brickCounts(dimensions);\n return [\n (index % countX) * WVDB_BRICK_DIM,\n (Math.floor(index / countX) % countY) * WVDB_BRICK_DIM,\n Math.floor(index / (countX * countY)) * WVDB_BRICK_DIM,\n ];\n}\n\n/** Appendix B: inflated page size. `varying` = brick channels with min !== max. */\nexport function pageByteSize(\n count: number,\n channels: number,\n bits: WvdbBits,\n sparse: boolean,\n varying: number,\n): number {\n return 4 + (sparse ? 4 * count : 0) + 8 * count * channels + varying * WVDB_BRICK_VOXELS * (bits / 8);\n}\n\n/** Appendix B: inflated points chunk size. */\nexport function pointsChunkByteSize(count: number, colors: boolean): number {\n return 4 + 24 + 6 * count + (colors ? 3 * count : 0);\n}\n\n/** §6.3: inflated mask size. */\nexport function maskByteSize(total: number): number {\n return Math.ceil(total / 32) * 4;\n}\n\n// ---------------------------------------------------------------------------\n// Page chunk (spec §6.2, §7)\n// ---------------------------------------------------------------------------\n\n/** One brick for the encoder: `values` holds 512 values per channel, one channel after the other. */\nexport interface WvdbBrickInput {\n index: number;\n values: Float32Array;\n}\n\nexport function encodePage(\n bricks: readonly WvdbBrickInput[],\n { layout, bits, channels }: { layout: WvdbLayout; bits: WvdbBits; channels: number },\n): Uint8Array {\n const sparse = layout === \"sparse\";\n const count = bricks.length;\n const codeSize = bits / 8;\n const maxCode = bits === 16 ? 0xffff : 0xff;\n const ranges = count * channels;\n const mins = new Float64Array(ranges);\n const maxs = new Float64Array(ranges);\n let varying = 0;\n\n for (let b = 0; b < count; b++) {\n const values = bricks[b]!.values;\n for (let c = 0; c < channels; c++) {\n let min = Infinity;\n let max = -Infinity;\n const end = (c + 1) * WVDB_BRICK_VOXELS;\n for (let i = c * WVDB_BRICK_VOXELS; i < end; i++) {\n // Math.min/max (not `<`) so -0 and 0 order exactly as in his encoder.\n min = Math.min(min, values[i]!);\n max = Math.max(max, values[i]!);\n }\n mins[b * channels + c] = Math.fround(min);\n maxs[b * channels + c] = Math.fround(max);\n if (mins[b * channels + c] !== maxs[b * channels + c]) varying++;\n }\n }\n\n const size = pageByteSize(count, channels, bits, sparse, varying);\n const out = new Uint8Array(size);\n const view = new DataView(out.buffer);\n let offset = 0;\n view.setUint32(offset, count, true);\n offset += 4;\n if (sparse) {\n for (const { index } of bricks) {\n view.setUint32(offset, index, true);\n offset += 4;\n }\n }\n for (let i = 0; i < ranges; i++, offset += 4) view.setFloat32(offset, mins[i]!, true);\n for (let i = 0; i < ranges; i++, offset += 4) view.setFloat32(offset, maxs[i]!, true);\n\n for (let b = 0; b < count; b++) {\n const values = bricks[b]!.values;\n for (let c = 0; c < channels; c++) {\n const min = mins[b * channels + c]!;\n const max = maxs[b * channels + c]!;\n if (min === max) continue;\n const scale = maxCode / (max - min);\n const end = (c + 1) * WVDB_BRICK_VOXELS;\n for (let i = c * WVDB_BRICK_VOXELS; i < end; i++) {\n const code = Math.min(Math.max(Math.round((values[i]! - min) * scale), 0), maxCode);\n if (codeSize === 2) view.setUint16(offset, code, true);\n else out[offset] = code;\n offset += codeSize;\n }\n }\n }\n return out;\n}\n\nexport interface DecodedPage {\n /** Brick indices, in page order. */\n indices: Uint32Array;\n /** Brick channel ranges, `b * channels + c`. */\n mins: Float32Array;\n maxs: Float32Array;\n /** 512 decoded values per brick channel, in brick channel order (brick 0 channel 0, brick 0 channel 1, ...). */\n values: Float32Array;\n}\n\n/**\n * Decodes one inflated page and validates its size exactly (Appendix B,\n * §14). `firstIndex` gives the implicit indices of a dense page.\n */\nexport function decodePage(\n bytes: Uint8Array,\n opts: { layout: WvdbLayout; bits: WvdbBits; channels: number; count: number; firstIndex: number; brickTotal: number },\n): DecodedPage {\n const { layout, bits, channels, count, firstIndex, brickTotal: total } = opts;\n const sparse = layout === \"sparse\";\n const fixed = pageByteSize(count, channels, bits, sparse, 0);\n if (bytes.byteLength < fixed) {\n throw new WvdbFormatError(`page: ${bytes.byteLength} bytes, expected at least ${fixed} for ${count} bricks`);\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const stored = view.getUint32(0, true);\n if (stored !== count) {\n throw new WvdbFormatError(`page: brickCount ${stored} does not match the header (${count})`);\n }\n let offset = 4;\n const indices = new Uint32Array(count);\n for (let i = 0; i < count; i++) {\n if (sparse) {\n indices[i] = view.getUint32(offset, true);\n offset += 4;\n } else {\n indices[i] = firstIndex + i;\n }\n if (indices[i]! >= total) {\n throw new WvdbFormatError(`page: brick index ${indices[i]} is not less than brickTotal ${total}`);\n }\n }\n const ranges = count * channels;\n const mins = new Float32Array(ranges);\n const maxs = new Float32Array(ranges);\n for (let i = 0; i < ranges; i++, offset += 4) mins[i] = view.getFloat32(offset, true);\n for (let i = 0; i < ranges; i++, offset += 4) maxs[i] = view.getFloat32(offset, true);\n let varying = 0;\n for (let i = 0; i < ranges; i++) if (mins[i] !== maxs[i]) varying++;\n const expected = pageByteSize(count, channels, bits, sparse, varying);\n if (bytes.byteLength !== expected) {\n throw new WvdbFormatError(`page: ${bytes.byteLength} bytes, expected ${expected} (Appendix B)`);\n }\n\n const maxCode = bits === 16 ? 0xffff : 0xff;\n const values = new Float32Array(ranges * WVDB_BRICK_VOXELS);\n for (let i = 0; i < ranges; i++) {\n const min = mins[i]!;\n const max = maxs[i]!;\n const target = i * WVDB_BRICK_VOXELS;\n if (min === max) {\n values.fill(min, target, target + WVDB_BRICK_VOXELS);\n continue;\n }\n const step = (max - min) / maxCode;\n for (let v = 0; v < WVDB_BRICK_VOXELS; v++) {\n let code: number;\n if (bits === 16) {\n code = view.getUint16(offset, true);\n offset += 2;\n } else {\n code = bytes[offset]!;\n offset += 1;\n }\n values[target + v] = code === maxCode ? max : min + code * step;\n }\n }\n return { indices, mins, maxs, values };\n}\n\n// ---------------------------------------------------------------------------\n// Mask chunk (spec §6.3)\n// ---------------------------------------------------------------------------\n\nexport function encodeMask(indices: Iterable<number>, total: number): Uint8Array {\n const words = new Uint32Array(Math.ceil(total / 32));\n for (const index of indices) words[index >>> 5]! |= 1 << (index & 31);\n const out = new Uint8Array(words.length * 4);\n const view = new DataView(out.buffer);\n words.forEach((word, i) => view.setUint32(i * 4, word, true));\n return out;\n}\n\nexport function decodeMask(bytes: Uint8Array, total: number): Uint32Array {\n const expected = maskByteSize(total);\n if (bytes.byteLength !== expected) {\n throw new WvdbFormatError(`mask: ${bytes.byteLength} bytes, expected ${expected}`);\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const words = new Uint32Array(expected >>> 2);\n for (let i = 0; i < words.length; i++) words[i] = view.getUint32(i * 4, true);\n const tail = total & 31;\n if (tail !== 0 && (words[words.length - 1]! >>> tail) !== 0) {\n throw new WvdbFormatError(`mask: bits after brick ${total - 1} are set`);\n }\n return words;\n}\n\nexport const isMaskBitSet = (words: Uint32Array, index: number): boolean =>\n (words[index >>> 5]! & (1 << (index & 31))) !== 0;\n\n// ---------------------------------------------------------------------------\n// Points chunk (spec §6.4)\n// ---------------------------------------------------------------------------\n\n/** `positions`: xyz per point. `colors`: rgb per point in [0, 1], or null. */\nexport function encodePoints(positions: Float32Array, colors: Float32Array | null): Uint8Array {\n const count = positions.length / 3;\n const out = new Uint8Array(pointsChunkByteSize(count, !!colors));\n const view = new DataView(out.buffer);\n view.setUint32(0, count, true);\n for (let axis = 0; axis < 3; axis++) {\n let min = Infinity;\n let max = -Infinity;\n for (let p = 0; p < count; p++) {\n min = Math.min(min, positions[p * 3 + axis]!);\n max = Math.max(max, positions[p * 3 + axis]!);\n }\n min = count > 0 ? Math.fround(min) : 0;\n max = count > 0 ? Math.fround(max) : 0;\n view.setFloat32(4 + axis * 4, min, true);\n view.setFloat32(16 + axis * 4, max, true);\n const scale = min === max ? 0 : POINT_CODE_MAX / (max - min);\n const high = 28 + axis * 2 * count;\n const low = high + count;\n for (let p = 0; p < count; p++) {\n const code = Math.min(Math.max(Math.round((positions[p * 3 + axis]! - min) * scale), 0), POINT_CODE_MAX);\n out[high + p] = code >>> 8;\n out[low + p] = code & 0xff;\n }\n }\n if (colors) {\n const start = 28 + 6 * count;\n for (let c = 0; c < 3; c++) {\n for (let p = 0; p < count; p++) {\n const v = colors[p * 3 + c]!;\n out[start + c * count + p] = Math.round(Math.min(Math.max(Number.isFinite(v) ? v : 1, 0), 1) * 255);\n }\n }\n }\n return out;\n}\n\nexport interface DecodedPoints {\n positions: Float32Array;\n colors: Float32Array | null;\n}\n\nexport function decodePoints(bytes: Uint8Array, { count, colors }: { count: number; colors: boolean }): DecodedPoints {\n const expected = pointsChunkByteSize(count, colors);\n if (bytes.byteLength !== expected) {\n throw new WvdbFormatError(`points: ${bytes.byteLength} bytes, expected ${expected}`);\n }\n const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n const stored = view.getUint32(0, true);\n if (stored !== count) {\n throw new WvdbFormatError(`points: pointCount ${stored} does not match the header (${count})`);\n }\n const positions = new Float32Array(count * 3);\n for (let axis = 0; axis < 3; axis++) {\n const min = view.getFloat32(4 + axis * 4, true);\n const max = view.getFloat32(16 + axis * 4, true);\n const step = (max - min) / POINT_CODE_MAX;\n const high = 28 + axis * 2 * count;\n const low = high + count;\n for (let p = 0; p < count; p++) {\n const code = (bytes[high + p]! << 8) | bytes[low + p]!;\n positions[p * 3 + axis] = code === POINT_CODE_MAX ? max : min + code * step;\n }\n }\n let rgb: Float32Array | null = null;\n if (colors) {\n rgb = new Float32Array(count * 3);\n const start = 28 + 6 * count;\n for (let c = 0; c < 3; c++) {\n for (let p = 0; p < count; p++) rgb[p * 3 + c] = bytes[start + c * count + p]! / 255;\n }\n }\n return { positions, colors: rgb };\n}\n\n/** A `.wvdb` file breaks the spec (bad magic, header, offsets, sizes); defined in `../errors.ts` (D32). */\nexport { WvdbFormatError };\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.wvdb` (mjurczyk's WebVDB format, spec v0.5.x, file versions 1 and 2):
|
|
3
|
+
* read, write, and bake from `.vdb` / NanoVDB. Portions derived from
|
|
4
|
+
* mjurczyk/openvdb (MIT), commit 75e7345 — see each module's header.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./format.js";
|
|
7
|
+
export * from "./read.js";
|
|
8
|
+
export * from "./write.js";
|
|
9
|
+
export * from "./bake.js";
|
|
10
|
+
export * from "./level-set.js";
|
|
11
|
+
export { sha256Hex } from "./sha256.js";
|
|
12
|
+
export * from "./dense.js";
|
|
13
|
+
export * from "./partial.js";
|
|
14
|
+
export * from "./nanovdb.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.wvdb` (mjurczyk's WebVDB format, spec v0.5.x, file versions 1 and 2):
|
|
3
|
+
* read, write, and bake from `.vdb` / NanoVDB. Portions derived from
|
|
4
|
+
* mjurczyk/openvdb (MIT), commit 75e7345 — see each module's header.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./format.js";
|
|
7
|
+
export * from "./read.js";
|
|
8
|
+
export * from "./write.js";
|
|
9
|
+
export * from "./bake.js";
|
|
10
|
+
export * from "./level-set.js";
|
|
11
|
+
export { sha256Hex } from "./sha256.js";
|
|
12
|
+
export * from "./dense.js";
|
|
13
|
+
export * from "./partial.js";
|
|
14
|
+
export * from "./nanovdb.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/wvdb/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC","sourcesContent":["/**\n * `.wvdb` (mjurczyk's WebVDB format, spec v0.5.x, file versions 1 and 2):\n * read, write, and bake from `.vdb` / NanoVDB. Portions derived from\n * mjurczyk/openvdb (MIT), commit 75e7345 — see each module's header.\n */\nexport * from \"./format.js\";\nexport * from \"./read.js\";\nexport * from \"./write.js\";\nexport * from \"./bake.js\";\nexport * from \"./level-set.js\";\nexport { sha256Hex } from \"./sha256.js\";\nexport * from \"./dense.js\";\nexport * from \"./partial.js\";\nexport * from \"./nanovdb.js\";\n"]}
|