@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,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `VDBGridPool`: many NanoVDB grids in one `GPUBuffer` behind a grid table
|
|
3
|
+
* (docs/dev/design/K1-core.md §1, §4; D8, D10).
|
|
4
|
+
*
|
|
5
|
+
* Model: CPU calls (`add`, `replace`, `remove`, `setTransform`, `setMajorant`,
|
|
6
|
+
* `buildMajorant`) stage changes and return at once; `update(encoder)` applies them
|
|
7
|
+
* (and records the staged GPU majorant builds, P1.15). Growth and
|
|
8
|
+
* compaction happen only in `update`, by a new buffer plus copies of the ranges
|
|
9
|
+
* that were resident before that update; `version` bumps then (and when a
|
|
10
|
+
* failed growth rolls back to the previous buffer).
|
|
11
|
+
*
|
|
12
|
+
* Lifecycle (docs/archive/handoffs/K1.md, "K1.3 pool lifecycle"):
|
|
13
|
+
* - A request that could never fit under the byte limit throws `VDB_POOL_LIMIT`
|
|
14
|
+
* at staging, with the pool unchanged.
|
|
15
|
+
* - Growth allocates inside `out-of-memory` and `validation` error scopes. The
|
|
16
|
+
* pool switches to the new buffer at once (update is synchronous) but keeps
|
|
17
|
+
* the old one alive until the scopes resolve; on an error it rolls back to the
|
|
18
|
+
* old buffer and reports through `settled()` / `lastError`.
|
|
19
|
+
* - A retired buffer is destroyed once its growth is confirmed, two `update`s
|
|
20
|
+
* have passed, and `queue.onSubmittedWorkDone()` asked at that point resolves.
|
|
21
|
+
*/
|
|
22
|
+
import { VDBError } from "../errors.js";
|
|
23
|
+
import { type VDBBrickMajorant, type VDBBrickMajorantOptions } from "../../tools/cpu/majorant.js";
|
|
24
|
+
import type { VDBGridTypeName, VDBSlot } from "../types.js";
|
|
25
|
+
import { type VDBVec3 } from "./layout.js";
|
|
26
|
+
/**
|
|
27
|
+
* A dense grid of upper (and optionally lower) bounds over a grid's index space, one f32 per brick of
|
|
28
|
+
* `2^brickLog2` voxels per side, x fastest (§5.1). Built by `tools` (`vdbBrickMajorant`); the pool only
|
|
29
|
+
* stores it (one declaration, shared with `@pmndrs/vdb/tools`, D32).
|
|
30
|
+
*/
|
|
31
|
+
export type { VDBBrickMajorant, VDBBrickMajorantOptions } from "../../tools/cpu/majorant.js";
|
|
32
|
+
/** A 4x4 column-major object-to-world matrix (three's `Matrix4.elements`), or `null` for the file's map. */
|
|
33
|
+
export type VDBTransformInput = Float32Array | Float64Array | readonly number[] | null;
|
|
34
|
+
/** Options for {@link VDBGridPool.create}. */
|
|
35
|
+
export interface VDBGridPoolOptions {
|
|
36
|
+
/** Initial buffer bytes (default 1 MiB); the first `update` grows it to fit. */
|
|
37
|
+
initialBytes?: number;
|
|
38
|
+
/** Initial table capacity in grids (default 16); the table doubles through the growth path. */
|
|
39
|
+
maxGrids?: number;
|
|
40
|
+
/** Upper bound on the buffer size (default: the device limit). */
|
|
41
|
+
maxBytes?: number;
|
|
42
|
+
/** Debug label for the buffers the pool creates. */
|
|
43
|
+
label?: string;
|
|
44
|
+
/** Extra `GPUBufferUsage` flags ORed into `STORAGE | COPY_DST | COPY_SRC`. */
|
|
45
|
+
usage?: number;
|
|
46
|
+
/**
|
|
47
|
+
* A host-owned buffer to use instead. It must have `STORAGE | COPY_DST`
|
|
48
|
+
* usage. The pool never destroys it and never grows it: when it is full,
|
|
49
|
+
* `add`/`replace`/`setMajorant` throw `VDB_POOL_FULL`.
|
|
50
|
+
*/
|
|
51
|
+
buffer?: GPUBuffer;
|
|
52
|
+
}
|
|
53
|
+
/** Options for {@link VDBGridPool.add}. */
|
|
54
|
+
export interface VDBAddOptions {
|
|
55
|
+
/** Bytes to reserve for the image (at least its size), so later `replace` calls fit in place. */
|
|
56
|
+
capacity?: number;
|
|
57
|
+
/** Instance transform (see {@link VDBGridPool.setTransform}). */
|
|
58
|
+
transform?: VDBTransformInput;
|
|
59
|
+
/** Brick-majorant bounds for this grid (see {@link VDBGridPool.setMajorant}). */
|
|
60
|
+
majorant?: VDBBrickMajorant;
|
|
61
|
+
/**
|
|
62
|
+
* Global bound of the grid's values (record word 35): what `vdbMajorantGlobal(g)` returns and the `'global'`
|
|
63
|
+
* majorant walk uses. Default `max(root max, background)` when the image has statistics, else +Infinity
|
|
64
|
+
* (see {@link VDBGridPool.setValueMax}, which also changes it later).
|
|
65
|
+
*/
|
|
66
|
+
valueMax?: number;
|
|
67
|
+
/** Free-form label, reported by `info`. */
|
|
68
|
+
label?: string;
|
|
69
|
+
}
|
|
70
|
+
/** What {@link VDBGridPool.info} reports about one grid. */
|
|
71
|
+
export interface VDBGridInfo {
|
|
72
|
+
/** The grid's pool id. */
|
|
73
|
+
id: number;
|
|
74
|
+
/** The grid's value type (a NanoVDB grid type name). */
|
|
75
|
+
type: VDBGridTypeName;
|
|
76
|
+
/** NanoVDB `GridType` id. */
|
|
77
|
+
gridTypeId: number;
|
|
78
|
+
/** NanoVDB `GridClass` name, e.g. `"FogVolume"`. */
|
|
79
|
+
gridClass: string;
|
|
80
|
+
/** NanoVDB `GridClass` id. */
|
|
81
|
+
gridClassId: number;
|
|
82
|
+
/** Grid name from the image header. */
|
|
83
|
+
name: string;
|
|
84
|
+
/** The `label` given to `add`, if any. */
|
|
85
|
+
label: string | undefined;
|
|
86
|
+
/** Size of the grid image in bytes. */
|
|
87
|
+
imageBytes: number;
|
|
88
|
+
/** Bytes reserved for the image (≥ `imageBytes`, 32 B multiple). */
|
|
89
|
+
capacity: number;
|
|
90
|
+
/** Byte offset of the image in the pool, or `null` until an `update` places it. */
|
|
91
|
+
imageOffset: number | null;
|
|
92
|
+
/** True once the image bytes are on the GPU (after the `update` that wrote them). */
|
|
93
|
+
resident: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The pool {@link VDBGridPool.revision} at this grid's last `add` or `replace`: changes exactly
|
|
96
|
+
* when the image's contents may have (not on `setTransform` / `setMajorant`). Data derived from the
|
|
97
|
+
* image (a coarse pyramid, K3.2a) rebuilds when it moves; ids reused after `remove` get a new one.
|
|
98
|
+
*/
|
|
99
|
+
imageRevision: number;
|
|
100
|
+
/** True when the image carries node statistics (min/max/average/deviation). */
|
|
101
|
+
hasStats: boolean;
|
|
102
|
+
/** True when brick-majorant bounds are set for this grid. */
|
|
103
|
+
hasBrickMajorant: boolean;
|
|
104
|
+
/** Byte offset of the majorant data in the pool, or `null` when none is placed. */
|
|
105
|
+
majorantOffset: number | null;
|
|
106
|
+
/** Brick counts of the majorant per axis, or `null` when none. */
|
|
107
|
+
majorantDims: VDBVec3 | null;
|
|
108
|
+
/** Index position of the majorant's cell 0 (P1.3), or `null` when none. */
|
|
109
|
+
majorantOrigin: VDBVec3 | null;
|
|
110
|
+
/** True when the majorant carries lower bounds (the module's `minima` reads them). */
|
|
111
|
+
majorantMinima: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* True when the pool builds the majorant itself ({@link VDBGridPool.buildMajorant}, P1.15: a compute pass that
|
|
114
|
+
* follows the image) rather than holding data the host set (`add(image, { majorant })`, `setMajorant`).
|
|
115
|
+
*/
|
|
116
|
+
majorantBuilt: boolean;
|
|
117
|
+
/** True when an instance transform (`setTransform`) is set. */
|
|
118
|
+
instanceTransform: boolean;
|
|
119
|
+
/** The tree's background value. */
|
|
120
|
+
background: number;
|
|
121
|
+
/**
|
|
122
|
+
* Global bound of the grid's values (record word 35): the host's (`add`'s `valueMax`, `setValueMax`), else
|
|
123
|
+
* `max(rootMax, background)`, else +Infinity for an image without statistics.
|
|
124
|
+
*/
|
|
125
|
+
valueMax: number;
|
|
126
|
+
/**
|
|
127
|
+
* The root node's min/max statistics as stored in the image (f32). Meaningful
|
|
128
|
+
* only when `hasStats`; without stats they are whatever the file holds
|
|
129
|
+
* (usually 0). `gridStats` and `decodeToAtlas` use them as their range.
|
|
130
|
+
*/
|
|
131
|
+
rootMin: number;
|
|
132
|
+
/** Root max statistic; see `rootMin`. */
|
|
133
|
+
rootMax: number;
|
|
134
|
+
/**
|
|
135
|
+
* The root node's average statistic: the mean of the grid's active values (f32), or NaN for an image without
|
|
136
|
+
* one. `VDBVolumeMaterial` (`@pmndrs/vdb/three`) sizes its default density by it.
|
|
137
|
+
*/
|
|
138
|
+
rootAverage: number;
|
|
139
|
+
/** Voxel size per axis in the grid's own world units (before the instance transform). */
|
|
140
|
+
voxelSize: VDBVec3;
|
|
141
|
+
/** Inclusive index-space box of the active voxels. */
|
|
142
|
+
indexBBox: {
|
|
143
|
+
min: VDBVec3;
|
|
144
|
+
max: VDBVec3;
|
|
145
|
+
};
|
|
146
|
+
/** World-space AABB of the index bbox's voxels (max corner + 1 voxel), through the record's f64 transform. */
|
|
147
|
+
worldBBox: {
|
|
148
|
+
min: VDBVec3;
|
|
149
|
+
max: VDBVec3;
|
|
150
|
+
};
|
|
151
|
+
/** f64 affines before f32 rounding, 3x4 row-major. */
|
|
152
|
+
worldToIndex: Float64Array;
|
|
153
|
+
/** Index-to-world affine, 3x4 row-major, f64. */
|
|
154
|
+
indexToWorld: Float64Array;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Many NanoVDB grids in one storage buffer, bound at one slot (D10). The pool
|
|
158
|
+
* takes the host's `GPUDevice`, records into the host's encoder, and frees only
|
|
159
|
+
* what it allocated (D8).
|
|
160
|
+
*
|
|
161
|
+
* Images passed to `add`/`replace` are held by reference (not copied) until the
|
|
162
|
+
* next `update` writes them, and after that while a growth is unconfirmed
|
|
163
|
+
* (until `settled()` resolves); don't mutate them before then.
|
|
164
|
+
*/
|
|
165
|
+
export declare class VDBGridPool {
|
|
166
|
+
#private;
|
|
167
|
+
/** The device the pool allocates on. */
|
|
168
|
+
readonly device: GPUDevice;
|
|
169
|
+
/**
|
|
170
|
+
* Use {@link VDBGridPool.create}.
|
|
171
|
+
*
|
|
172
|
+
* @param device The host's device.
|
|
173
|
+
* @param buffer The pool buffer.
|
|
174
|
+
* @param owns True when the pool created `buffer` and frees it.
|
|
175
|
+
* @param capacity Grid table capacity in grids.
|
|
176
|
+
* @param limit Upper bound on the buffer size in bytes.
|
|
177
|
+
* @param label Debug label of the buffers.
|
|
178
|
+
* @param usage Extra `GPUBufferUsage` flags of the buffer.
|
|
179
|
+
*/
|
|
180
|
+
private constructor();
|
|
181
|
+
/**
|
|
182
|
+
* Creates a pool on `device`. Throws `VDB_UNSUPPORTED_DEVICE` (see
|
|
183
|
+
* {@link unsupportedReason}) or `VDB_BAD_OPTION`. The returned pool is
|
|
184
|
+
* bindable at once (an empty table).
|
|
185
|
+
*
|
|
186
|
+
* @param device The host's `GPUDevice`.
|
|
187
|
+
* @param options Initial size, table capacity, limits, label, usage and an optional host buffer.
|
|
188
|
+
*/
|
|
189
|
+
static create(device: GPUDevice, options?: VDBGridPoolOptions): Promise<VDBGridPool>;
|
|
190
|
+
/** True when `device` can hold a pool. */
|
|
191
|
+
static isSupported(device: GPUDevice): boolean;
|
|
192
|
+
/** Why `device` can't hold a pool, or `null`. */
|
|
193
|
+
static unsupportedReason(device: GPUDevice): string | null;
|
|
194
|
+
/** Limits for `adapter.requestDevice({ requiredLimits })` so the pool can grow to the adapter's maxima. */
|
|
195
|
+
static requiredLimits(adapter: GPUAdapter): Record<string, number>;
|
|
196
|
+
/**
|
|
197
|
+
* The pool's buffer. Replaced by a growth in `update`, or by the rollback of
|
|
198
|
+
* a growth whose allocation failed (asynchronously; see `settled`); `version`
|
|
199
|
+
* changes each time.
|
|
200
|
+
*/
|
|
201
|
+
get buffer(): GPUBuffer;
|
|
202
|
+
/**
|
|
203
|
+
* +1 whenever `buffer` changes object: rebuild bind groups. Monotonic: a
|
|
204
|
+
* failed growth's rollback to the previous buffer is a new version too.
|
|
205
|
+
*
|
|
206
|
+
* Read it after `update(encoder)`: call `update(encoder)` before building
|
|
207
|
+
* or reusing bind groups this frame. A bind group built before `update()`
|
|
208
|
+
* keeps the previous (still-alive) buffer and silently misses new grids.
|
|
209
|
+
*/
|
|
210
|
+
get version(): number;
|
|
211
|
+
/** +1 on every content change (add, replace, remove, setTransform, setValueMax, setMajorant, buildMajorant). */
|
|
212
|
+
get revision(): number;
|
|
213
|
+
/** {@link VDB_GPU_LAYOUT_VERSION}. */
|
|
214
|
+
get layoutVersion(): number;
|
|
215
|
+
/** Size of `buffer` in bytes. */
|
|
216
|
+
get byteLength(): number;
|
|
217
|
+
/** Allocation high-water mark in bytes (header word 6). */
|
|
218
|
+
get usedBytes(): number;
|
|
219
|
+
/** Bytes in replaced buffers still alive: awaiting growth confirmation or the queue (see `update`). */
|
|
220
|
+
get retiredBytes(): number;
|
|
221
|
+
/**
|
|
222
|
+
* The error from the last growth whose allocation failed (`VDB_POOL_LIMIT`;
|
|
223
|
+
* the pool rolled back to its previous buffer), or `null`. Cleared when a
|
|
224
|
+
* later growth is confirmed.
|
|
225
|
+
*/
|
|
226
|
+
get lastError(): VDBError | null;
|
|
227
|
+
/**
|
|
228
|
+
* Resolves once every growth started so far is confirmed by the device;
|
|
229
|
+
* rejects with the `VDB_POOL_LIMIT` error if one failed and the pool rolled
|
|
230
|
+
* back (see {@link lastError}). Resolves at once when no growth is pending.
|
|
231
|
+
*/
|
|
232
|
+
settled(): Promise<void>;
|
|
233
|
+
/** Records in the grid table. */
|
|
234
|
+
get gridCapacity(): number;
|
|
235
|
+
/** Highest live id + 1 (header word 3). */
|
|
236
|
+
get gridCount(): number;
|
|
237
|
+
/**
|
|
238
|
+
* Grid types of the live grids now, for `vdbCheckModule` and
|
|
239
|
+
* `vdbModuleWgsl({ types })`. It does not know about grids the host adds
|
|
240
|
+
* later: generate the module for every type the host may add (see `add`).
|
|
241
|
+
*/
|
|
242
|
+
get types(): ReadonlySet<VDBGridTypeName>;
|
|
243
|
+
/**
|
|
244
|
+
* Stages a grid image and returns its id at once. The image is validated
|
|
245
|
+
* here (`VDB_BAD_IMAGE`, `VDB_UNSUPPORTED_GRID_TYPE`) and written by the next
|
|
246
|
+
* `update`. Dead ids are reused, lowest first.
|
|
247
|
+
*
|
|
248
|
+
* The shader reading this pool decodes only the types its module was
|
|
249
|
+
* generated for; a grid of any other type reads as 0. A module must
|
|
250
|
+
* therefore be generated for every type the host may add (its known set,
|
|
251
|
+
* or `VDB_ALL_SCALAR_TYPES`), or regenerated and its pipeline rebuilt when
|
|
252
|
+
* a new type arrives. Call `vdbCheckModule(pool, options)` after `add` to
|
|
253
|
+
* catch a mismatch (`VDB_TYPE_NOT_COMPILED`).
|
|
254
|
+
*
|
|
255
|
+
* @param image A NanoVDB grid image (one grid) as 32-bit words.
|
|
256
|
+
* @param options Reserved capacity, transform, majorant, density bound and label.
|
|
257
|
+
*/
|
|
258
|
+
add(image: Uint32Array, options?: VDBAddOptions): number;
|
|
259
|
+
/**
|
|
260
|
+
* Stages a new image for grid `id`. It is written in place when it fits the
|
|
261
|
+
* grid's reserved range (no `version` change: the sequence-player path), else
|
|
262
|
+
* moved. A brick majorant set on the grid is dropped (it described the old
|
|
263
|
+
* image); call `setMajorant` again. Transform, label and `valueMax` are kept.
|
|
264
|
+
*
|
|
265
|
+
* @param id The grid's pool id.
|
|
266
|
+
* @param image The new grid image, as for `add`.
|
|
267
|
+
*/
|
|
268
|
+
replace(id: number, image: Uint32Array): void;
|
|
269
|
+
/** Frees grid `id`'s ranges and clears its record; the id may be reused by the next `add`. */
|
|
270
|
+
remove(id: number): void;
|
|
271
|
+
/**
|
|
272
|
+
* Sets grid `id`'s instance transform: a 4x4 column-major object-to-world
|
|
273
|
+
* matrix (WebGPU / three convention), or `null` for the file's own map. The
|
|
274
|
+
* pool composes `worldToIndex = map⁻¹ ∘ objectToWorld⁻¹` and `indexToWorld`
|
|
275
|
+
* in f64 and rounds to f32. Only the record changes; the image is untouched.
|
|
276
|
+
*
|
|
277
|
+
* @param id The grid's pool id.
|
|
278
|
+
* @param objectToWorld A 4x4 column-major matrix, or `null` for the file's own map.
|
|
279
|
+
*/
|
|
280
|
+
setTransform(id: number, objectToWorld: VDBTransformInput): void;
|
|
281
|
+
/**
|
|
282
|
+
* Stores brick-majorant bounds for grid `id` in the pool (record words
|
|
283
|
+
* 36–39, flag b2, brick log2 in b16–23), or clears them with `null`.
|
|
284
|
+
*
|
|
285
|
+
* @param id The grid's pool id.
|
|
286
|
+
* @param majorant The brick bounds, or `null` to clear them.
|
|
287
|
+
*/
|
|
288
|
+
setMajorant(id: number, majorant: VDBBrickMajorant | null): void;
|
|
289
|
+
/**
|
|
290
|
+
* Builds grid `id`'s brick majorant on the GPU (P1.15; K1-core §5.1) instead of taking CPU data: the next
|
|
291
|
+
* `update(encoder)` records a compute pass into `encoder`, after its writes, that fills the majorant range
|
|
292
|
+
* (header, upper bounds, optional lower bounds). The result equals `tools` `vdbBrickMajorant(image, options)`
|
|
293
|
+
* bit for bit (same options, same layout; Fp8 / FpN on a GPU that fuses the decode's multiply-add may differ by
|
|
294
|
+
* the reader's 1 ulp, as `vdbReadValue` itself does).
|
|
295
|
+
*
|
|
296
|
+
* The build follows the image: `replace` lays it out again and the next `update` rebuilds it (a sequence
|
|
297
|
+
* keeps GPU bricks without a CPU pass per frame). `setMajorant` replaces it with CPU data, `null` clears it.
|
|
298
|
+
* Record passes that read the majorant after that `update`.
|
|
299
|
+
*
|
|
300
|
+
* @param id The grid's pool id.
|
|
301
|
+
* @param options As `vdbBrickMajorant`'s: `brickLog2` (0..6 on the GPU), `minima`, `align`, `outside`, `resolution`.
|
|
302
|
+
* @throws VDBError `VDB_BAD_OPTION` for invalid options (as the CPU builder), `VDB_POOL_LIMIT` / `VDB_POOL_FULL` as `setMajorant`.
|
|
303
|
+
*/
|
|
304
|
+
buildMajorant(id: number, options?: VDBBrickMajorantOptions): void;
|
|
305
|
+
/**
|
|
306
|
+
* Sets grid `id`'s global value bound (record word 35; EX1f-a), or with `null` returns to the default. Only
|
|
307
|
+
* the record changes: the next `update` writes 160 bytes, and `version` does not move. The bound is kept
|
|
308
|
+
* across `replace`, as `add`'s `valueMax` is, so set it again (or pass `null`) when the new image needs another.
|
|
309
|
+
*
|
|
310
|
+
* It is what `vdbMajorantGlobal(g)` returns and what the `'global'` majorant walk uses (a `'brick'` module
|
|
311
|
+
* walks a grid without brick bounds the same way), so every sample of the grid must be at or under it.
|
|
312
|
+
*
|
|
313
|
+
* The default, `max(root max, background)`, costs nothing and holds whenever the inactive values are the
|
|
314
|
+
* background, but it counts a root background that no voxel near the grid may hold: 3 against 1 on a fog
|
|
315
|
+
* volume converted from a level set, and with `outside: 'zero'` a background the field never takes outside
|
|
316
|
+
* the bbox. `vdbValueRange(image, { outside }).max` (`@pmndrs/vdb/tools`) is the exact bound over the box the
|
|
317
|
+
* walks cover; for a fog volume whose inactive voxels are 0, `Math.max(pool.info(id).rootMax, 0)` is the
|
|
318
|
+
* same number without the tree walk. An image without statistics has no default (+Infinity): give it a
|
|
319
|
+
* bound here (`vdbCheckModule` throws `VDB_NO_STATS` for a majorant module that would walk it).
|
|
320
|
+
*
|
|
321
|
+
* @param id The grid's pool id.
|
|
322
|
+
* @param valueMax The bound, or `null` for the default.
|
|
323
|
+
* @throws VDBError `VDB_BAD_OPTION` when `valueMax` is not a number, `VDB_UNKNOWN_GRID` for a dead id.
|
|
324
|
+
*/
|
|
325
|
+
setValueMax(id: number, valueMax: number | null): void;
|
|
326
|
+
/**
|
|
327
|
+
* The live grids whose global bound (`info(id).valueMax`) is not finite: images without statistics that the
|
|
328
|
+
* host gave no `valueMax`. A majorant walk that falls back on the global bound cannot use them;
|
|
329
|
+
* `vdbCheckModule(pool, options)` reads this list.
|
|
330
|
+
*/
|
|
331
|
+
get unboundedGrids(): {
|
|
332
|
+
id: number;
|
|
333
|
+
hasStats: boolean;
|
|
334
|
+
hasBrickMajorant: boolean;
|
|
335
|
+
}[];
|
|
336
|
+
/** Describes grid `id`. Throws `VDB_UNKNOWN_GRID` for a dead or out-of-range id. */
|
|
337
|
+
info(id: number): VDBGridInfo;
|
|
338
|
+
/**
|
|
339
|
+
* Applies staged changes, recording any copies into `encoder`:
|
|
340
|
+
* 1. asks the queue about buffers retired at least two updates ago (once
|
|
341
|
+
* their growth is confirmed); each is destroyed when
|
|
342
|
+
* `onSubmittedWorkDone` resolves;
|
|
343
|
+
* 2. if the staged state doesn't fit, grows (or, when only fragmentation
|
|
344
|
+
* blocks a placement, compacts) into a new buffer, copying ranges that
|
|
345
|
+
* were resident before this call, and bumps `version`. The allocation is
|
|
346
|
+
* checked in error scopes; if it fails, the pool rolls back later (see
|
|
347
|
+
* {@link settled}). Planned before anything changes: when the staged
|
|
348
|
+
* grids together pass the byte limit, nothing is re-laid out;
|
|
349
|
+
* 3. writes new images, majorants, dirty records and the header with
|
|
350
|
+
* `queue.writeBuffer`, for ranges placed in the current buffer (a grid
|
|
351
|
+
* still waiting for space reads as dead on the GPU).
|
|
352
|
+
* Then, if step 2 hit the limit, throws `VDB_POOL_LIMIT` (buffer and
|
|
353
|
+
* `version` unchanged; remove grids and update again).
|
|
354
|
+
*
|
|
355
|
+
* Submit `encoder` before the second `update` after this one (one update of
|
|
356
|
+
* slack): a buffer this update retires stays alive until then.
|
|
357
|
+
*
|
|
358
|
+
* Call `update(encoder)` before building or reusing bind groups this frame,
|
|
359
|
+
* then compare `version` with the version the bind group was built at. A
|
|
360
|
+
* bind group built before `update()` keeps the previous (still-alive)
|
|
361
|
+
* buffer and silently misses new grids: no validation error, just stale
|
|
362
|
+
* data.
|
|
363
|
+
*/
|
|
364
|
+
update(encoder: GPUCommandEncoder): void;
|
|
365
|
+
/** Convenience: creates an encoder, calls `update`, and submits it. */
|
|
366
|
+
flush(): void;
|
|
367
|
+
/**
|
|
368
|
+
* The bind group entry for `slot`: `{ binding: slot.firstBinding, resource: { buffer } }`.
|
|
369
|
+
* Takes the same `VDBSlot` as `vdbModuleWgsl({ slot })` and
|
|
370
|
+
* `vdbModuleEntries(slot)`.
|
|
371
|
+
*
|
|
372
|
+
* It names the current `buffer`, so call `update(encoder)` before building
|
|
373
|
+
* or reusing bind groups this frame, and rebuild when `version` changed. A
|
|
374
|
+
* bind group built before `update()` keeps the previous (still-alive)
|
|
375
|
+
* buffer and silently misses new grids.
|
|
376
|
+
*/
|
|
377
|
+
bindGroupEntry(slot: VDBSlot): GPUBindGroupEntry;
|
|
378
|
+
/**
|
|
379
|
+
* Destroys every buffer this pool created (current, retired, and those of an
|
|
380
|
+
* unconfirmed growth) at once, never a host buffer or the device. Submit no
|
|
381
|
+
* work recorded by `update` after this. Idempotent.
|
|
382
|
+
*/
|
|
383
|
+
dispose(): void;
|
|
384
|
+
}
|