@pmndrs/vdb 0.1.0 → 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 +592 -2
- package/README.md +85 -37
- package/THIRD_PARTY_NOTICES.md +197 -29
- package/dist/core/compute/atlas.d.ts +10 -2
- package/dist/core/compute/atlas.js +6 -1
- package/dist/core/compute/atlas.js.map +1 -1
- package/dist/core/compute/index.d.ts +3 -3
- package/dist/core/compute/index.js +2 -2
- package/dist/core/compute/index.js.map +1 -1
- 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 +22 -7
- package/dist/core/compute/pyramid.js +22 -9
- package/dist/core/compute/pyramid.js.map +1 -1
- package/dist/core/compute/shared.d.ts +1 -0
- package/dist/core/compute/shared.js.map +1 -1
- package/dist/core/compute/stats.d.ts +10 -3
- package/dist/core/compute/stats.js +6 -1
- package/dist/core/compute/stats.js.map +1 -1
- package/dist/core/compute/value-transform.d.ts +8 -1
- package/dist/core/compute/value-transform.js +9 -3
- package/dist/core/compute/value-transform.js.map +1 -1
- package/dist/core/errors.d.ts +10 -0
- package/dist/core/errors.js +8 -0
- package/dist/core/errors.js.map +1 -1
- 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 +25 -3
- package/dist/core/index.js +23 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/internal.d.ts +17 -1
- package/dist/core/internal.js +18 -1
- package/dist/core/internal.js.map +1 -1
- package/dist/core/pool/image-header.d.ts +13 -2
- package/dist/core/pool/image-header.js +24 -5
- package/dist/core/pool/image-header.js.map +1 -1
- package/dist/core/pool/layout.d.ts +35 -1
- package/dist/core/pool/layout.js +51 -2
- package/dist/core/pool/layout.js.map +1 -1
- package/dist/core/pool/limits.d.ts +1 -0
- package/dist/core/pool/limits.js +1 -0
- package/dist/core/pool/limits.js.map +1 -1
- package/dist/core/pool/pool.d.ts +120 -15
- package/dist/core/pool/pool.js +255 -24
- package/dist/core/pool/pool.js.map +1 -1
- 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/{three → core}/sequence.d.ts +32 -2
- package/dist/{three → core}/sequence.js +24 -2
- 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 +33 -2
- package/dist/core/source/dense.js +121 -24
- package/dist/core/source/dense.js.map +1 -1
- 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 +59 -2
- package/dist/core/source/types.js.map +1 -1
- 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 +12 -3
- package/dist/core/types.js +6 -2
- package/dist/core/types.js.map +1 -1
- package/dist/core/wgsl/api.d.ts +29 -5
- package/dist/core/wgsl/api.js +110 -27
- package/dist/core/wgsl/api.js.map +1 -1
- package/dist/core/wgsl/generate.d.ts +8 -0
- package/dist/core/wgsl/generate.js +195 -22
- package/dist/core/wgsl/generate.js.map +1 -1
- 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 +5 -1
- package/dist/core/wgsl/level-set.js +11 -5
- package/dist/core/wgsl/level-set.js.map +1 -1
- 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 +2 -2
- package/dist/core/wgsl/pnanovdb.chunks.generated.js +15 -12
- package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -1
- package/dist/core/wgsl/types.d.ts +97 -3
- package/dist/core/wgsl/types.js.map +1 -1
- package/dist/three/coarse-first.d.ts +53 -8
- package/dist/three/coarse-first.js +24 -6
- package/dist/three/coarse-first.js.map +1 -1
- package/dist/three/compute.d.ts +12 -2
- package/dist/three/compute.js +16 -6
- package/dist/three/compute.js.map +1 -1
- package/dist/three/device.d.ts +7 -0
- package/dist/three/device.js +3 -0
- package/dist/three/device.js.map +1 -1
- 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 +64 -114
- package/dist/three/frame/emission-light.js +188 -567
- package/dist/three/frame/emission-light.js.map +1 -1
- package/dist/three/frame/index.d.ts +11 -31
- package/dist/three/frame/index.js +9 -29
- package/dist/three/frame/index.js.map +1 -1
- package/dist/three/frame/medium.d.ts +12 -0
- package/dist/three/frame/medium.js.map +1 -1
- package/dist/three/frame/renderer.d.ts +58 -454
- package/dist/three/frame/renderer.js +409 -1427
- package/dist/three/frame/renderer.js.map +1 -1
- package/dist/three/frame/spectrum.d.ts +0 -14
- package/dist/three/frame/spectrum.js +2 -23
- package/dist/three/frame/spectrum.js.map +1 -1
- package/dist/three/frame/three-internals.d.ts +3 -8
- package/dist/three/frame/three-internals.js +13 -11
- package/dist/three/frame/three-internals.js.map +1 -1
- package/dist/three/frame/volume-shadows.d.ts +93 -107
- package/dist/three/frame/volume-shadows.js +278 -631
- package/dist/three/frame/volume-shadows.js.map +1 -1
- package/dist/three/frame/volume.d.ts +91 -33
- package/dist/three/frame/volume.js +63 -51
- package/dist/three/frame/volume.js.map +1 -1
- package/dist/three/grid-node.d.ts +34 -1
- package/dist/three/grid-node.js +36 -1
- package/dist/three/grid-node.js.map +1 -1
- package/dist/three/index.d.ts +20 -11
- package/dist/three/index.js +21 -12
- package/dist/three/index.js.map +1 -1
- package/dist/three/internal.d.ts +14 -8
- package/dist/three/internal.js +11 -7
- package/dist/three/internal.js.map +1 -1
- package/dist/three/level-set-material.d.ts +81 -8
- package/dist/three/level-set-material.js +162 -125
- package/dist/three/level-set-material.js.map +1 -1
- 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 +141 -11
- package/dist/three/material.js +161 -18
- package/dist/three/material.js.map +1 -1
- package/dist/three/points.d.ts +60 -4
- package/dist/three/points.js +140 -9
- package/dist/three/points.js.map +1 -1
- package/dist/three/sparse-source.d.ts +49 -117
- package/dist/three/sparse-source.js +109 -580
- package/dist/three/sparse-source.js.map +1 -1
- package/dist/three/volume-source.d.ts +11 -156
- package/dist/three/volume-source.js +29 -272
- package/dist/three/volume-source.js.map +1 -1
- 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 +23 -4
- package/dist/tools/cpu/compute.js +35 -14
- package/dist/tools/cpu/compute.js.map +1 -1
- 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 +42 -3
- package/dist/tools/cpu/level-set.js +59 -7
- package/dist/tools/cpu/level-set.js.map +1 -1
- 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 +93 -2
- package/dist/tools/cpu/march.js +165 -14
- package/dist/tools/cpu/march.js.map +1 -1
- 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/read-value.d.ts +19 -6
- package/dist/tools/cpu/read-value.js +32 -17
- package/dist/tools/cpu/read-value.js.map +1 -1
- package/dist/tools/cpu/sample-trilinear.d.ts +17 -4
- package/dist/tools/cpu/sample-trilinear.js +19 -7
- package/dist/tools/cpu/sample-trilinear.js.map +1 -1
- package/dist/tools/cpu/stride-tables.d.ts +2 -2
- package/dist/tools/cpu/stride-tables.generated.d.ts +6 -5
- package/dist/tools/cpu/stride-tables.generated.js +7 -6
- package/dist/tools/cpu/stride-tables.generated.js.map +1 -1
- package/dist/tools/cpu/stride-tables.js +1 -1
- package/dist/tools/cpu/stride-tables.js.map +1 -1
- 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 +9 -0
- package/dist/tools/errors.js +9 -0
- package/dist/tools/errors.js.map +1 -1
- 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 +15 -0
- package/dist/tools/frame/blackbody.js +35 -0
- package/dist/tools/frame/blackbody.js.map +1 -1
- 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 +9 -0
- package/dist/tools/frame/emission.js +9 -1
- package/dist/tools/frame/emission.js.map +1 -1
- 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 +3 -2
- package/dist/tools/frame/environment.js +8 -4
- package/dist/tools/frame/environment.js.map +1 -1
- 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 +90 -0
- package/dist/tools/frame/grid.js +112 -13
- package/dist/tools/frame/grid.js.map +1 -1
- package/dist/tools/frame/index.d.ts +14 -0
- package/dist/tools/frame/index.js +45 -4
- package/dist/tools/frame/index.js.map +1 -1
- package/dist/tools/frame/medium.d.ts +16 -0
- package/dist/tools/frame/medium.js +3 -1
- package/dist/tools/frame/medium.js.map +1 -1
- package/dist/tools/frame/mie.d.ts +9 -0
- package/dist/tools/frame/mie.js +18 -0
- package/dist/tools/frame/mie.js.map +1 -1
- 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 +6 -5
- package/dist/tools/frame/neural-weights.js +234 -235
- package/dist/tools/frame/neural-weights.js.map +1 -1
- package/dist/tools/frame/neural.js +1 -1
- package/dist/tools/frame/neural.js.map +1 -1
- 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 +17 -0
- package/dist/tools/frame/pyramid-layout.js +47 -0
- package/dist/tools/frame/pyramid-layout.js.map +1 -1
- package/dist/tools/frame/shadows.d.ts +110 -0
- package/dist/tools/frame/shadows.js +286 -0
- package/dist/tools/frame/shadows.js.map +1 -1
- package/dist/tools/frame/sparse.d.ts +82 -0
- package/dist/tools/frame/sparse.js +242 -1
- package/dist/tools/frame/sparse.js.map +1 -1
- 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 +21 -2
- package/dist/tools/frame/spectral.js +30 -8
- package/dist/tools/frame/spectral.js.map +1 -1
- 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 +66 -15
- package/dist/tools/index.js +55 -11
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/internal.d.ts +58 -17
- package/dist/tools/internal.js +65 -11
- package/dist/tools/internal.js.map +1 -1
- package/dist/tools/nanovdb/build-from-vdb.d.ts +11 -2
- package/dist/tools/nanovdb/build-from-vdb.js +10 -2
- package/dist/tools/nanovdb/build-from-vdb.js.map +1 -1
- package/dist/tools/nanovdb/bytes.d.ts +17 -4
- package/dist/tools/nanovdb/bytes.js +46 -3
- package/dist/tools/nanovdb/bytes.js.map +1 -1
- package/dist/tools/nanovdb/coarse-first.d.ts +19 -3
- package/dist/tools/nanovdb/coarse-first.js +7 -1
- package/dist/tools/nanovdb/coarse-first.js.map +1 -1
- 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 +3 -1
- package/dist/tools/nanovdb/index.js +2 -1
- package/dist/tools/nanovdb/index.js.map +1 -1
- package/dist/tools/nanovdb/inspect.d.ts +10 -1
- package/dist/tools/nanovdb/inspect.js +8 -1
- package/dist/tools/nanovdb/inspect.js.map +1 -1
- package/dist/tools/nanovdb/leaf-codec.d.ts +35 -1
- package/dist/tools/nanovdb/leaf-codec.js +40 -4
- package/dist/tools/nanovdb/leaf-codec.js.map +1 -1
- package/dist/tools/nanovdb/quantize.d.ts +39 -10
- package/dist/tools/nanovdb/quantize.js +96 -44
- package/dist/tools/nanovdb/quantize.js.map +1 -1
- package/dist/tools/nanovdb/resample.d.ts +20 -3
- package/dist/tools/nanovdb/resample.js +20 -7
- package/dist/tools/nanovdb/resample.js.map +1 -1
- package/dist/tools/nanovdb/serialize.d.ts +34 -3
- package/dist/tools/nanovdb/serialize.js +51 -7
- package/dist/tools/nanovdb/serialize.js.map +1 -1
- package/dist/tools/nanovdb/stats.d.ts +34 -5
- package/dist/tools/nanovdb/stats.js +87 -11
- package/dist/tools/nanovdb/stats.js.map +1 -1
- package/dist/tools/nanovdb/transform.d.ts +4 -0
- package/dist/tools/nanovdb/transform.js +3 -0
- package/dist/tools/nanovdb/transform.js.map +1 -1
- package/dist/tools/nanovdb/tree.d.ts +14 -3
- package/dist/tools/nanovdb/tree.js +25 -13
- package/dist/tools/nanovdb/tree.js.map +1 -1
- package/dist/tools/nanovdb/write-nvdb.d.ts +47 -12
- package/dist/tools/nanovdb/write-nvdb.js +108 -28
- package/dist/tools/nanovdb/write-nvdb.js.map +1 -1
- package/dist/tools/nvdb-file.d.ts +77 -7
- package/dist/tools/nvdb-file.js +177 -20
- package/dist/tools/nvdb-file.js.map +1 -1
- package/dist/tools/nvdb-stream.d.ts +23 -7
- package/dist/tools/nvdb-stream.js +78 -34
- package/dist/tools/nvdb-stream.js.map +1 -1
- 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/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 +35 -5
- package/dist/tools/vdb/blosc.js +82 -26
- package/dist/tools/vdb/blosc.js.map +1 -1
- 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 +13 -3
- package/dist/tools/vdb/byte-reader.js +26 -4
- package/dist/tools/vdb/byte-reader.js.map +1 -1
- package/dist/tools/vdb/compression.d.ts +13 -5
- package/dist/tools/vdb/compression.js +13 -2
- package/dist/tools/vdb/compression.js.map +1 -1
- package/dist/tools/vdb/grid.js +8 -2
- package/dist/tools/vdb/grid.js.map +1 -1
- package/dist/tools/vdb/index.d.ts +2 -1
- package/dist/tools/vdb/index.js.map +1 -1
- 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.js +1 -1
- package/dist/tools/vdb/metadata.js.map +1 -1
- package/dist/tools/vdb/parse.d.ts +24 -2
- package/dist/tools/vdb/parse.js +102 -32
- package/dist/tools/vdb/parse.js.map +1 -1
- package/dist/tools/vdb/point-render-data.d.ts +49 -1
- package/dist/tools/vdb/point-render-data.js +91 -11
- package/dist/tools/vdb/point-render-data.js.map +1 -1
- package/dist/tools/vdb/points.d.ts +26 -0
- package/dist/tools/vdb/points.js +46 -5
- package/dist/tools/vdb/points.js.map +1 -1
- package/dist/tools/vdb/types.d.ts +59 -2
- package/dist/tools/vdb/types.js.map +1 -1
- package/dist/tools/wvdb/bake.d.ts +38 -9
- package/dist/tools/wvdb/bake.js +63 -13
- package/dist/tools/wvdb/bake.js.map +1 -1
- package/dist/tools/wvdb/dense.d.ts +80 -1
- package/dist/tools/wvdb/dense.js +67 -8
- package/dist/tools/wvdb/dense.js.map +1 -1
- package/dist/tools/wvdb/format.d.ts +59 -0
- package/dist/tools/wvdb/format.js +3 -0
- package/dist/tools/wvdb/format.js.map +1 -1
- package/dist/tools/wvdb/index.d.ts +1 -0
- package/dist/tools/wvdb/index.js +1 -0
- package/dist/tools/wvdb/index.js.map +1 -1
- package/dist/tools/wvdb/level-set.d.ts +10 -2
- package/dist/tools/wvdb/level-set.js.map +1 -1
- package/dist/tools/wvdb/nanovdb.d.ts +6 -1
- package/dist/tools/wvdb/nanovdb.js +5 -1
- package/dist/tools/wvdb/nanovdb.js.map +1 -1
- 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 +77 -1
- package/dist/tools/wvdb/read.js +30 -7
- package/dist/tools/wvdb/read.js.map +1 -1
- package/dist/tools/wvdb/write.d.ts +23 -1
- package/dist/tools/wvdb/write.js +8 -1
- package/dist/tools/wvdb/write.js.map +1 -1
- package/package.json +2 -1
- package/vendor/VENDOR.md +21 -6
- package/vendor/pnanovdb.wgsl +52 -14
- package/dist/three/frame/blackbody.d.ts +0 -42
- package/dist/three/frame/blackbody.js +0 -74
- package/dist/three/frame/blackbody.js.map +0 -1
- package/dist/three/frame/chunks.d.ts +0 -157
- package/dist/three/frame/chunks.js +0 -559
- package/dist/three/frame/chunks.js.map +0 -1
- package/dist/three/frame/density-material.d.ts +0 -53
- package/dist/three/frame/density-material.js +0 -353
- package/dist/three/frame/density-material.js.map +0 -1
- package/dist/three/frame/environment-grid-material.d.ts +0 -21
- package/dist/three/frame/environment-grid-material.js +0 -184
- package/dist/three/frame/environment-grid-material.js.map +0 -1
- package/dist/three/frame/environment-material.d.ts +0 -22
- package/dist/three/frame/environment-material.js +0 -87
- package/dist/three/frame/environment-material.js.map +0 -1
- package/dist/three/frame/grid-mip-material.d.ts +0 -12
- package/dist/three/frame/grid-mip-material.js +0 -61
- package/dist/three/frame/grid-mip-material.js.map +0 -1
- package/dist/three/frame/inject-material.d.ts +0 -56
- package/dist/three/frame/inject-material.js +0 -424
- package/dist/three/frame/inject-material.js.map +0 -1
- package/dist/three/frame/integrate-material.d.ts +0 -26
- package/dist/three/frame/integrate-material.js +0 -198
- package/dist/three/frame/integrate-material.js.map +0 -1
- package/dist/three/frame/layout.d.ts +0 -34
- package/dist/three/frame/layout.js +0 -48
- package/dist/three/frame/layout.js.map +0 -1
- package/dist/three/frame/lighting-material.d.ts +0 -41
- package/dist/three/frame/lighting-material.js +0 -257
- package/dist/three/frame/lighting-material.js.map +0 -1
- package/dist/three/frame/lights.d.ts +0 -11
- package/dist/three/frame/lights.js +0 -16
- package/dist/three/frame/lights.js.map +0 -1
- package/dist/three/frame/neural.d.ts +0 -14
- package/dist/three/frame/neural.js +0 -105
- package/dist/three/frame/neural.js.map +0 -1
- package/dist/three/frame/phase.d.ts +0 -44
- package/dist/three/frame/phase.js +0 -80
- package/dist/three/frame/phase.js.map +0 -1
- package/dist/three/frame/shadow-density-material.d.ts +0 -30
- package/dist/three/frame/shadow-density-material.js +0 -123
- package/dist/three/frame/shadow-density-material.js.map +0 -1
- package/dist/three/frame/temporal-material.d.ts +0 -29
- package/dist/three/frame/temporal-material.js +0 -152
- package/dist/three/frame/temporal-material.js.map +0 -1
- package/dist/three/frame/transmittance-material.d.ts +0 -31
- package/dist/three/frame/transmittance-material.js +0 -315
- package/dist/three/frame/transmittance-material.js.map +0 -1
- package/dist/three/frame/view.d.ts +0 -103
- package/dist/three/frame/view.js +0 -296
- package/dist/three/frame/view.js.map +0 -1
- package/dist/three/frame/volume-shadow-material.d.ts +0 -36
- package/dist/three/frame/volume-shadow-material.js +0 -128
- package/dist/three/frame/volume-shadow-material.js.map +0 -1
- package/dist/three/sequence.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @pmndrs/vdb
|
|
2
2
|
|
|
3
|
-
Sparse NanoVDB volumes on WebGPU: an engine-free WGSL core
|
|
4
|
-
|
|
3
|
+
Sparse NanoVDB volumes on WebGPU: an engine-free WGSL core with a compute froxel volume renderer, level-set and point
|
|
4
|
+
passes, pure-TypeScript CPU tools and a thin three.js adapter. One package, three subpaths.
|
|
5
5
|
|
|
6
6
|
[Docs](https://pmndrs.github.io/vdb/) · [Examples](https://pmndrs.github.io/vdb/examples/) · [GitHub](https://github.com/pmndrs/vdb) · [Changelog](./CHANGELOG.md)
|
|
7
7
|
|
|
8
8
|
| Import | What it is | Needs a GPU / three? |
|
|
9
9
|
|---|---|---|
|
|
10
|
-
| `@pmndrs/vdb` | the engine-free WebGPU core: `VDBGridPool`, the generated `vdb*` WGSL module (`vdbModuleWgsl`), GPU compute tools | WebGPU, no engine |
|
|
11
|
-
| `@pmndrs/vdb/tools` | CPU side: `.nvdb` and `.wvdb` read/write, CPU reads (`vdbReadValueCpu`, `
|
|
12
|
-
| `@pmndrs/vdb/three` | the three.js
|
|
10
|
+
| `@pmndrs/vdb` | the engine-free WebGPU core: `VDBGridPool`, the generated `vdb*` WGSL module (`vdbModuleWgsl`), GPU compute tools, the froxel renderer (`vdbCreateFrameRenderer`), volume sources (`vdbSparseSource`, `vdbDenseSource`), level-set and point passes, `VDBSequence` | WebGPU, no engine |
|
|
11
|
+
| `@pmndrs/vdb/tools` | CPU side: `.nvdb` and `.wvdb` read/write, CPU reads (`vdbReadValueCpu`, `vdbSampleTrilinearCpu`), `.vdb` parser, NanoVDB builder, quantizer, resampler | no |
|
|
12
|
+
| `@pmndrs/vdb/three` | the three.js adapter: `VDBGridNode` (a pool in three's node system), `VDBVolumeMaterial`, `VDBFrameVolume` / `VDBFrameRenderer` (the core's froxel renderer on three's device), `VDBLevelSetMaterial` / `VDBLevelSetPhysicalMaterial`, `VDBPoints`, compute utilities | `three` (optional peer, `>=0.187.0 <0.188.0`) |
|
|
13
13
|
| `@pmndrs/vdb/pnanovdb.wgsl` | the raw WGSL text (use `?raw` in Vite) | no |
|
|
14
14
|
|
|
15
15
|
```sh
|
|
@@ -20,22 +20,51 @@ npm install @pmndrs/vdb three # to use @pmndrs/vdb/three
|
|
|
20
20
|
`three` is an optional peer dependency (r187 only). `@webgpu/types` and `fflate` are regular dependencies.
|
|
21
21
|
`core` and `tools` never import `three`.
|
|
22
22
|
|
|
23
|
+
Coming from 0.1? 0.2.0 moved the froxel renderer into the core, dropped the `Gpu` suffix from the core's names, added
|
|
24
|
+
`Cpu` to the tools' CPU readers and renamed several `@pmndrs/vdb/three` names; a few defaults change images
|
|
25
|
+
(`ambientOcclusion` and `occlusion` are on, `'neural'` uses our own weights):
|
|
26
|
+
[Migrating from 0.1 to 0.2](https://pmndrs.github.io/vdb/reference/migrating-0-2) and the
|
|
27
|
+
[changelog](./CHANGELOG.md).
|
|
28
|
+
|
|
23
29
|
## `@pmndrs/vdb` (core) and the raw WGSL module
|
|
24
30
|
|
|
25
31
|
The engine-free WebGPU layer: `VDBGridPool` (NanoVDB grids in one storage buffer on the host's `GPUDevice`), the
|
|
26
|
-
generated `vdb*` WGSL module for reading, sampling and marching them (`vdbModuleWgsl`),
|
|
27
|
-
|
|
32
|
+
generated `vdb*` WGSL module for reading, sampling and marching them (`vdbModuleWgsl`), GPU compute tools, and since
|
|
33
|
+
0.2.0 the froxel volume renderer, its volume sources and the level-set and point passes. It knows nothing about
|
|
34
|
+
three.js or any other engine. Loading `.nvdb` files is in `@pmndrs/vdb/tools` (`NvdbFile`).
|
|
35
|
+
|
|
36
|
+
### The froxel renderer on raw WebGPU (0.2.0)
|
|
37
|
+
|
|
38
|
+
`vdbCreateFrameRenderer(device)` (`VDBFrameRenderer`) renders volumes through a froxel grid as WGSL compute
|
|
39
|
+
kernels: `'volume'` or `'frame'` lighting, temporal accumulation, phase functions (including Lorenz-Mie), multiple
|
|
40
|
+
scattering, spectral media, an environment, volume shadow maps for your meshes (volume → mesh), your depth maps
|
|
41
|
+
shadowing the volumes (mesh → volume) and an emission light. It takes your `GPUDevice`, records into your encoder
|
|
42
|
+
(`update(encoder, input)`, then `render(encoder, targets)` or `vdbFrameIntegrateWgsl` in your own pass), frees only
|
|
43
|
+
what it made and never submits. Sources: `vdbSparseSource` (every grid of a `VDBGridPool`, with LOD) and
|
|
44
|
+
`vdbDenseSource` (`.wvdb` textures). `vdbCreateLevelSetPass` and `vdbCreatePointPass` draw level sets and points
|
|
45
|
+
into your passes. Settings out of the device's range (`shadowResolution`, shadow map sizes) clamp with a one-time
|
|
46
|
+
warning. `multipleScattering` defaults to `'neural'` (our trained network, K6.N, on the core's EXPERIMENTAL generic MLP).
|
|
47
|
+
Demo 17 is a full raw-WebGPU page; see
|
|
48
|
+
[docs/site/core/rendering-without-three.mdx](https://github.com/pmndrs/vdb/blob/main/docs/site/core/rendering-without-three.mdx).
|
|
49
|
+
|
|
50
|
+
### Majorants and the lean reader (0.2.0)
|
|
51
|
+
|
|
52
|
+
For delta and ratio tracking, `vdbModuleWgsl({ profile: 'majorant' })` adds `vdbMajorantInit` / `vdbMajorantNext`: a
|
|
53
|
+
walk of piecewise-constant density bounds along a ray, over brick bounds built on the CPU (`vdbBrickMajorant`,
|
|
54
|
+
`@pmndrs/vdb/tools`) or on the GPU (`pool.buildMajorant(id)`). `reader: 'lean'` generates a compact reader with the
|
|
55
|
+
same API and values (about a fifth of the size for Float `read`). See
|
|
56
|
+
[docs/site/core/wgsl-module.mdx](https://github.com/pmndrs/vdb/blob/main/docs/site/core/wgsl-module.mdx).
|
|
28
57
|
|
|
29
58
|
### What's in the box
|
|
30
59
|
|
|
31
60
|
- **`vendor/pnanovdb.wgsl`** — a WGSL module with the NanoVDB root ->
|
|
32
61
|
upper -> lower -> leaf tree traversal, HDDA ray marching, and
|
|
33
|
-
Float/Fp4/Fp8/Fp16/FpN value decoders. Import it as raw text (`?raw` in Vite,
|
|
62
|
+
Float/Fp4/Fp8/Fp16/FpN/Half value decoders. Import it as raw text (`?raw` in Vite,
|
|
34
63
|
or read the file yourself) and splice it into your own shader.
|
|
35
64
|
- **`NvdbFile`** (`@pmndrs/vdb/tools`) — parses a `.nvdb` file (header + per-grid metadata +
|
|
36
|
-
grid images), handling the NONE
|
|
37
|
-
- **A pure-TypeScript CPU reference** (`@pmndrs/vdb/tools`: `vdbReadValueCpu`, `
|
|
38
|
-
`
|
|
65
|
+
grid images), handling the NONE, ZIP and BLOSC codecs.
|
|
66
|
+
- **A pure-TypeScript CPU reference** (`@pmndrs/vdb/tools`: `vdbReadValueCpu`, `vdbReadValueF32Cpu`,
|
|
67
|
+
`vdbSampleTrilinearCpu`) — the exact same tree descent as the WGSL
|
|
39
68
|
module, so you can sanity-check GPU results or read voxels with no GPU
|
|
40
69
|
at all (Node, workers, tests).
|
|
41
70
|
|
|
@@ -89,13 +118,14 @@ module from it. Integrations to copy from instead of re-deriving the binding:
|
|
|
89
118
|
| `Fp8` | yes | per-leaf min/quantum, 1 byte/voxel |
|
|
90
119
|
| `FpN` | yes | per-leaf variable bit-width (oracle-matched to native) |
|
|
91
120
|
| `Fp4`, `Fp16` | yes | per-leaf min/quantum |
|
|
121
|
+
| `Half` | yes | raw IEEE binary16, 2 bytes/voxel (NanoVDB 13.2+; matches native v14) |
|
|
92
122
|
| other `GridType`s | rejected | `NvdbFile` throws a clear "unsupported grid type" error |
|
|
93
123
|
|
|
94
124
|
| File codec | Support |
|
|
95
125
|
|---|---|
|
|
96
126
|
| `NONE` | yes |
|
|
97
127
|
| `ZIP` (zlib, via `fflate`) | read and write (`writeNvdb(images, { codec: 'zip' })`) |
|
|
98
|
-
| `BLOSC` |
|
|
128
|
+
| `BLOSC` | read: NanoVDB's LZ4 frames (`nanovdb_convert -b/--blosc`, any chunking) and NVIDIA Warp's BloscLZ frames. Write: `writeNvdb(images, { codec: 'blosc' })`, LZ4 frames byte-identical to native NanoVDB v14's (0.2.0) |
|
|
99
129
|
|
|
100
130
|
### The vendoring story
|
|
101
131
|
|
|
@@ -113,7 +143,7 @@ fixes if the author engages. Full pin/hash/diff-log details:
|
|
|
113
143
|
|
|
114
144
|
The CPU half: parse `.vdb` containers, build
|
|
115
145
|
NanoVDB grid images (from a dense array or straight from a parsed `.vdb`),
|
|
116
|
-
quantize to Fp4/Fp8/Fp16/FpN, apply affine transforms, inspect memory layout, and
|
|
146
|
+
quantize to Fp4/Fp8/Fp16/FpN/Half, apply affine transforms, inspect memory layout, and
|
|
117
147
|
write `.nvdb` files — all **pure TypeScript, no WASM** (the one runtime dependency is
|
|
118
148
|
`fflate` for zlib; [decision D3](https://github.com/pmndrs/vdb/blob/main/docs/archive/v1/DECISIONS.md#d3--cpu-half-pure-typescript-first-wasm-as-targeted-escalation)).
|
|
119
149
|
WASM stays an optional escalation rung, adopted only on demonstrated need
|
|
@@ -155,7 +185,7 @@ The drop-in-a-file pipeline, trimmed from
|
|
|
155
185
|
import { parseVdb, buildFromVdbDetailed, vdbInspect } from "@pmndrs/vdb/tools";
|
|
156
186
|
|
|
157
187
|
const buffer = await fetch("/fixtures/vdb-samples/utahteapot.vdb").then((r) => r.arrayBuffer());
|
|
158
|
-
const vdbFile = parseVdb(buffer); // { fileVersion, grids: VdbGrid[] }
|
|
188
|
+
const vdbFile = parseVdb(buffer); // { fileVersion, grids: VdbGrid[], descriptors: VdbGridDescriptor[] }
|
|
159
189
|
|
|
160
190
|
const built = buildFromVdbDetailed(vdbFile.grids[0]!); // streams leaves, no dense allocation
|
|
161
191
|
const report = vdbInspect(built.image);
|
|
@@ -171,15 +201,20 @@ the NanoVDB `Map`.
|
|
|
171
201
|
|
|
172
202
|
| Function | What it does |
|
|
173
203
|
|---|---|
|
|
174
|
-
| `parseVdb(buffer)` | Reads a `.vdb` container: float, vec3 and point grids, 5-4-3 tree, uncompressed, zlib or Blosc, active tiles |
|
|
204
|
+
| `parseVdb(buffer, { select }?)` | Reads a `.vdb` container (file version 225 or older): float, half (as float), vec3 and point grids, 5-4-3 tree, uncompressed, zlib or Blosc, active tiles. `select(descriptor)` picks which grids to decode; `descriptors` lists every grid, an unsupported one reported rather than thrown |
|
|
175
205
|
| `vdbBuildFromDense` / `vdbBuildFromDenseDetailed` | Dense `Float32Array` -> NanoVDB FLOAT grid image |
|
|
176
206
|
| `vdbBuildFromLeavesDetailed` | Lower-level: build from an already-leaf-shaped source (what `buildFromVdb` and `vdbQuantize` are built on) |
|
|
177
207
|
| `buildFromVdb` / `buildFromVdbDetailed` | Parsed `.vdb` grid -> NanoVDB FLOAT grid image, leaf-streamed |
|
|
178
|
-
| `vdbQuantize` / `vdbQuantizeDetailed` | FLOAT grid image -> Fp4/Fp8/Fp16/FpN (per-leaf min/quantum; FpN bit-width picked per leaf) |
|
|
208
|
+
| `vdbQuantize` / `vdbQuantizeDetailed` | FLOAT grid image -> Fp4/Fp8/Fp16/FpN (per-leaf min/quantum; FpN bit-width picked per leaf) or Half (binary16) |
|
|
179
209
|
| `vdbTransform` | Metadata-only affine edit (uniform scale + translate) on a copy; throws with a GPU-resample pointer for rotation/shear ([D6](https://github.com/pmndrs/vdb/blob/main/docs/archive/v1/DECISIONS.md#d6--browser-first-companion-service-is-an-interim-crutch-to-eliminate)) |
|
|
210
|
+
| `vdbTreeNodes` | Generator over a scalar grid image's tree: leaves (origin, active voxel count), tiles (level, origin, size, value, active) and, on request, the upper and lower nodes |
|
|
180
211
|
| `vdbInspect` | Node counts + memory-by-section breakdown, summing to the grid's total byte size |
|
|
181
|
-
| `writeNvdb` | Serializes one or more grid images into a `.nvdb` file `ArrayBuffer` (NanoVDB2, `io::Segment` layout; `
|
|
212
|
+
| `writeNvdb` | Serializes one or more grid images into a `.nvdb` file `ArrayBuffer` (NanoVDB2, `io::Segment` layout; `codec: 'zip'` or `'blosc'` for NanoVDB's codecs; `segments: 'per-grid'` writes one segment per grid, which native `io::readGrid(file, n)` needs) |
|
|
182
213
|
| `vdbBakeCoarseFirst` | Coarse-first `.nvdb`: a small preview grid (`<name>.lod48`, box, FpN) then the full grid, ZIP by default |
|
|
214
|
+
| `vdbLevelSetMesh` / `vdbLevelSetMeshChunks` | A triangle mesh of a level set's zero surface (surface nets over the sparse leaves), whole or in chunks, for collision and export |
|
|
215
|
+
| `vdbLevelSetMeshDecimate` | Fewer triangles for such a mesh or chunk: edge collapses kept within `error` voxels of the grid's iso surface (checked at sample points on each changed triangle); seams survive |
|
|
216
|
+
| `vdbBrickMajorant` / `vdbBrickAtlas` | Brick bounds for delta and ratio tracking (`pool.add(image, { majorant })`, the `majorant` WGSL profile), and pmndrs/pathtracer's sparse brick atlas |
|
|
217
|
+
| `vdbPointRenderData` | Positions, colours and other attributes of a parsed point grid as flat arrays for `VDBPoints` or the core point pass |
|
|
183
218
|
| `NvdbStreamReader` / `readNvdbStream` | Reads a `.nvdb` from pushed bytes or a stream, emitting each grid as soon as its data is complete; hostile-input checks before allocation |
|
|
184
219
|
| `NvdbFile` | Reads a `.nvdb` held in memory or fetched (`fromArrayBuffer` / `fromURL`); there is no separate `readNvdb` |
|
|
185
220
|
|
|
@@ -187,10 +222,11 @@ the NanoVDB `Map`.
|
|
|
187
222
|
|
|
188
223
|
| | Support |
|
|
189
224
|
|---|---|
|
|
190
|
-
| Grid type | float, vec3 (`Vec3f`/`Vec3d`/`Vec3i`) and point data grids |
|
|
225
|
+
| Grid type | float, half (`HalfGrid`, OpenVDB 13+; read as float, `gridType` keeps `Tree_half_5_4_3`), vec3 (`Vec3f`/`Vec3d`/`Vec3i`) and point data grids |
|
|
191
226
|
| Tree configuration | 5-4-3 (OpenVDB's default) |
|
|
192
|
-
| Compression | none, zlib, Blosc (LZ4 and zlib) |
|
|
227
|
+
| Compression | none, zlib, Blosc (LZ4, BloscLZ and zlib) |
|
|
193
228
|
| Half-float leaf storage | yes |
|
|
229
|
+
| File version | up to 225 (what OpenVDB v14 writes); a newer one throws `VDBUnsupportedError` |
|
|
194
230
|
| Transform | uniform scale + translate (affine `Map`); non-uniform/rotated throws on `vdbTransform()`, parses fine on `parseVdb()`/`buildFromVdb()` |
|
|
195
231
|
|
|
196
232
|
### Native parity
|
|
@@ -212,7 +248,7 @@ The three.js adapter over the engine-free core (D8), on three r187 (D23). The
|
|
|
212
248
|
grids live in a `VDBGridPool` on the renderer's `GPUDevice`; `VDBGridNode`
|
|
213
249
|
puts that pool into three's node system without copying it (three binds the
|
|
214
250
|
pool's own buffer); `VDBVolumeMaterial` raymarches one pooled grid, and
|
|
215
|
-
`VDBSequence` plays frames into one pool id.
|
|
251
|
+
`VDBSequence` (the core's, re-exported) plays frames into one pool id.
|
|
216
252
|
|
|
217
253
|
### Quickstart: render a cloud
|
|
218
254
|
|
|
@@ -240,7 +276,7 @@ pool.flush(); // writes the grid (or record pool.update(encoder) into your own e
|
|
|
240
276
|
// One VDBGridNode per pool, renderer and shader (one WGSL module per shader).
|
|
241
277
|
// The material needs the support-box ray clip helper.
|
|
242
278
|
const grids = new VDBGridNode(renderer, pool, { helpers: ["rayClipSupport"] });
|
|
243
|
-
const material = new VDBVolumeMaterial(renderer, grids, id
|
|
279
|
+
const material = new VDBVolumeMaterial(renderer, grids, id); // the defaults are sized to the grid
|
|
244
280
|
const scene = new THREE.Scene();
|
|
245
281
|
scene.add(new THREE.Mesh(vdbProxyGeometry(pool.info(id)), material));
|
|
246
282
|
|
|
@@ -269,17 +305,23 @@ await renderer.renderAsync(scene, camera);
|
|
|
269
305
|
one `wgslFn` over the public API: world ray to index space through the pool
|
|
270
306
|
record (`pool.setTransform` instances work), clipped to the trilinear
|
|
271
307
|
support box, fixed-step density with `vdbSample`, Henyey-Greenstein sun with
|
|
272
|
-
a shadow march, ambient, and a per-fragment sample budget.
|
|
273
|
-
a
|
|
308
|
+
a shadow march, ambient, and a per-fragment sample budget. The defaults draw
|
|
309
|
+
a lit volume on any grid: `opticalDepth` (6) is the optical depth across the
|
|
310
|
+
grid's longest index side at its mean density (`densityReference`, read from
|
|
311
|
+
`pool.info(id).rootAverage` at each render), and the shadow ray spans
|
|
312
|
+
`shadowReach` (0.3) of that side. `densityScale` > 0 is the extinction per
|
|
313
|
+
index voxel instead (0.1's look: `{ densityScale: 40, sunIntensity: 3,
|
|
314
|
+
shadowReach: 0 }`). Every tunable is a live uniform
|
|
315
|
+
(`material.opticalDepth.value = 10`, `material.stepSize.value`,
|
|
274
316
|
`maxSteps`, `sunDirection`, `sunColor`, `sunIntensity`, `anisotropy`,
|
|
275
|
-
`shadowSteps`, `shadowDensity`, `ambient`, `jitter`); `gridId` is a `uint`
|
|
317
|
+
`shadowSteps`, `shadowDensity`, `shadowReach`, `ambient`, `jitter`); `gridId` is a `uint`
|
|
276
318
|
uniform when given as a number, so `material.gridId.value = other` switches
|
|
277
319
|
grids without a rebuild (give the mesh a new `vdbProxyGeometry` for the
|
|
278
320
|
other grid, and after `pool.setTransform`). Caps (`maxStepsCap`,
|
|
279
321
|
`shadowStepsCap`, `sampleBudgetCap`) are compiled in. The march runs in index
|
|
280
|
-
space: `stepSize` is in index voxels and
|
|
281
|
-
|
|
282
|
-
opacity. Perspective cameras only. `grids` must come from the same renderer.
|
|
322
|
+
space: `stepSize` is in index voxels and the density is relative to the index
|
|
323
|
+
box (or per index voxel with `densityScale`), so scaling a grid with
|
|
324
|
+
`setTransform` changes its size on screen, not its opacity. Perspective cameras only. `grids` must come from the same renderer.
|
|
283
325
|
- **`vdbProxyGeometry(pool.info(id), { pad? })`**: the world box to put the
|
|
284
326
|
material on (add the mesh with an identity transform). `pad: 1` also covers
|
|
285
327
|
the min-side half voxel of the trilinear support.
|
|
@@ -299,12 +341,12 @@ records into your encoder and hands back a readback you resolve after
|
|
|
299
341
|
submitting; the three wrappers take the renderer and return promises:
|
|
300
342
|
|
|
301
343
|
```ts
|
|
302
|
-
import { VDBGridPool,
|
|
344
|
+
import { VDBGridPool, vdbGridStats, vdbDecodeToAtlas, vdbApplyValueTransform } from "@pmndrs/vdb";
|
|
303
345
|
|
|
304
346
|
const id = pool.add(image);
|
|
305
347
|
pool.update(encoder); // or pool.flush()
|
|
306
|
-
const stats =
|
|
307
|
-
const atlas =
|
|
348
|
+
const stats = vdbGridStats(device, pool, id, { encoder, histogramBins: 256 });
|
|
349
|
+
const atlas = vdbDecodeToAtlas(device, pool, id, { encoder, maxDim: 128, format: "uint8" });
|
|
308
350
|
device.queue.submit([encoder.finish()]);
|
|
309
351
|
// With your encoder, say it was submitted before reading (read() earlier rejects with VDB_BAD_OPTION):
|
|
310
352
|
await stats.submitted().read(); // { min, max, mean, histogram, activeVoxelCount, usedAtomicFastPath, range }
|
|
@@ -325,9 +367,9 @@ The three wrappers submit their own encoder. The value transform has no three
|
|
|
325
367
|
wrapper: call the core `vdbApplyValueTransform`.
|
|
326
368
|
|
|
327
369
|
Each tool frees only the buffers it allocated (in `read()` or `dispose()`).
|
|
328
|
-
`
|
|
370
|
+
`vdbGridStats` bins over the grid's root min/max statistics (a grid with a
|
|
329
371
|
negative root min takes the dump path, 8 B per bbox voxel, and is refused up
|
|
330
|
-
front when that exceeds the device's buffer limits); `
|
|
372
|
+
front when that exceeds the device's buffer limits); `vdbDecodeToAtlas`
|
|
331
373
|
normalizes to them by default. Atlas cell `i` of an axis with `n` cells over `[min, max]` samples index position
|
|
332
374
|
`min + (i + 0.5) * (max - min + 1) / n - 0.5`, so at full resolution cell `i` is
|
|
333
375
|
voxel `min + i` (the last cell is `max`); the texture spans the voxel-centred box
|
|
@@ -347,7 +389,7 @@ preview to the pool with the full grid's size reserved, and replaces it in place
|
|
|
347
389
|
import { vdbStreamCoarseFirst } from "@pmndrs/vdb/three";
|
|
348
390
|
|
|
349
391
|
const { id } = await vdbStreamCoarseFirst(pool, await fetch("/smoke.coarse.nvdb"), {
|
|
350
|
-
// After each swap: densityScale = base x voxelRatio (
|
|
392
|
+
// After each swap: an explicit densityScale = base x voxelRatio (it is per index voxel), the proxy box
|
|
351
393
|
// from pool.info(id), pool.flush() + grids.update(), and `majorant(event)` re-applied (replace drops it).
|
|
352
394
|
bind: { material, mesh, grids },
|
|
353
395
|
onGrid: (e) => console.log(e.final ? "full" : "preview"),
|
|
@@ -370,6 +412,7 @@ import { VDBSequence } from "@pmndrs/vdb/three";
|
|
|
370
412
|
// (no pool.version change, no VDBGridNode rebind, no new bind group).
|
|
371
413
|
const id = pool.add(firstFrame, { capacity: largestFrameBytes });
|
|
372
414
|
const material = new VDBVolumeMaterial(renderer, grids, id);
|
|
415
|
+
material.densityReferenceAuto = false; // keep the first frame's density scale for every frame
|
|
373
416
|
|
|
374
417
|
const sequence = new VDBSequence({
|
|
375
418
|
urls: (i) => `/fixtures/embergen/pack/frame_${i}.nvdb`,
|
|
@@ -406,14 +449,19 @@ the update that wrote it.
|
|
|
406
449
|
|
|
407
450
|
`VDBFrameVolume` and `VDBFrameRenderer` (ported from mjurczyk/openvdb, re-based on the sparse pool) render volumes
|
|
408
451
|
through a froxel grid with `'volume'` or `'frame'` lighting, temporal accumulation, phase functions (including
|
|
409
|
-
Lorenz-Mie), multiple scattering (two-sided, octaves, neural), spectral media and measured presets, mesh
|
|
410
|
-
emission light.
|
|
452
|
+
Lorenz-Mie), multiple scattering (two-sided, octaves, neural, multi-scale), spectral media and measured presets, mesh
|
|
453
|
+
shadows both ways and an emission light. Since 0.2.0 every frame is drawn by the core's froxel renderer (above) on
|
|
454
|
+
three's device: `VDBFrameRenderer` is a thin adapter (`frameRenderer.core` is the `VDBFrameRenderer`), and its
|
|
455
|
+
`settings` are the core's `VDBFrameSettings`. Volume sources are dense (`vdbDenseTextures`) or sparse
|
|
456
|
+
(`vdbSparseSource`, with LOD). See
|
|
411
457
|
[docs/site/three/frame-renderer.mdx](https://github.com/pmndrs/vdb/blob/main/docs/site/three/frame-renderer.mdx).
|
|
412
458
|
|
|
413
459
|
### Level sets and points
|
|
414
460
|
|
|
415
|
-
`VDBLevelSetMaterial` sphere-traces a level-set grid as a lit mesh surface (three's lights, shadows and depth)
|
|
416
|
-
`
|
|
461
|
+
`VDBLevelSetMaterial` sphere-traces a level-set grid as a lit mesh surface (three's lights, shadows and depth);
|
|
462
|
+
`VDBLevelSetPhysicalMaterial` is the same trace on three's physical material (transmissive glass, clearcoat).
|
|
463
|
+
`VDBPoints` draws a `.vdb` point grid (`vdbPointRenderData`) as instanced sprites, and streams `.wvdb` points LOD by
|
|
464
|
+
LOD (`VDBPoints.fromWvdbGrid`, `addWvdbLevel`).
|
|
417
465
|
|
|
418
466
|
### `.wvdb`
|
|
419
467
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -8,14 +8,15 @@ copy of this list is [THIRD_PARTY.md](https://github.com/pmndrs/vdb/blob/main/TH
|
|
|
8
8
|
|
|
9
9
|
Parts of the `.wvdb` reader, writer and baker, the dense and sparse volume sources, the froxel renderer, level sets
|
|
10
10
|
and points are ported from [mjurczyk/openvdb](https://github.com/mjurczyk/openvdb) (pinned commit `75e7345`,
|
|
11
|
-
v0.26.0
|
|
12
|
-
|
|
11
|
+
v0.26.0; later commits are noted per file). The froxel renderer's ports live in the core frame renderer
|
|
12
|
+
(`src/core/frame/`) and the `./three` adapter. The upstream repository has an MIT LICENSE file since v0.32.0 (before that its npm packages declared MIT and
|
|
13
|
+
the author had confirmed the licence); the copyright line below is his LICENSE's. This notice applies to the files listed below, each of which carries a header "Portions derived from
|
|
13
14
|
mjurczyk/openvdb (MIT)" (or "derived from") naming its upstream paths.
|
|
14
15
|
|
|
15
16
|
```
|
|
16
17
|
MIT License
|
|
17
18
|
|
|
18
|
-
Copyright (c) mjurczyk
|
|
19
|
+
Copyright (c) 2022-present mjurczyk
|
|
19
20
|
|
|
20
21
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
21
22
|
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
|
@@ -35,70 +36,82 @@ DEALINGS IN THE SOFTWARE.
|
|
|
35
36
|
Source files in this package that derive from it (paths are in the source tree; the package ships them compiled
|
|
36
37
|
under `dist/`):
|
|
37
38
|
|
|
39
|
+
- `src/core/compute/multi-scale.ts` (commit `4e2d46f`)
|
|
38
40
|
- `src/core/compute/pyramid.ts`
|
|
41
|
+
- `src/core/frame/emission.ts`
|
|
42
|
+
- `src/core/frame/phase.ts`
|
|
43
|
+
- `src/core/frame/renderer.ts` (also commits `4b5393d`, `92421cc`, v0.31.0)
|
|
44
|
+
- `src/core/frame/scattering.ts` (also commits `4e2d46f`, `92421cc`)
|
|
45
|
+
- `src/core/frame/settings.ts`
|
|
46
|
+
- `src/core/frame/shadows.ts` (also commits `62a6e3e`, `c13f2d5`)
|
|
47
|
+
- `src/core/frame/wgsl/chunks.ts`
|
|
48
|
+
- `src/core/frame/wgsl/emission.ts`
|
|
49
|
+
- `src/core/frame/wgsl/environment.ts`
|
|
50
|
+
- `src/core/frame/wgsl/gather.ts`
|
|
51
|
+
- `src/core/frame/wgsl/integrate.ts`
|
|
52
|
+
- `src/core/frame/wgsl/lighting.ts` (also commit `4b5393d`, v0.31.0)
|
|
53
|
+
- `src/core/frame/wgsl/resolve.ts`
|
|
54
|
+
- `src/core/frame/wgsl/shadows.ts` (also commit `62a6e3e`)
|
|
55
|
+
- `src/core/source/dense-fill.ts`
|
|
39
56
|
- `src/core/source/dense.ts`
|
|
57
|
+
- `src/core/source/sparse-wgsl.ts`
|
|
58
|
+
- `src/core/source/sparse.ts`
|
|
59
|
+
- `src/core/surface/level-set-wgsl.ts`
|
|
60
|
+
- `src/core/surface/points.ts`
|
|
40
61
|
- `src/core/wgsl/level-set.ts`
|
|
41
|
-
- `src/three/frame/
|
|
42
|
-
- `src/three/frame/chunks.ts`
|
|
43
|
-
- `src/three/frame/density-material.ts`
|
|
62
|
+
- `src/three/frame/core-integrate-material.ts`
|
|
44
63
|
- `src/three/frame/emission-light.ts`
|
|
45
|
-
- `src/three/frame/environment-grid-material.ts`
|
|
46
|
-
- `src/three/frame/environment-material.ts`
|
|
47
|
-
- `src/three/frame/grid-mip-material.ts`
|
|
48
|
-
- `src/three/frame/inject-material.ts`
|
|
49
|
-
- `src/three/frame/integrate-material.ts`
|
|
50
|
-
- `src/three/frame/layout.ts`
|
|
51
|
-
- `src/three/frame/lighting-material.ts`
|
|
52
|
-
- `src/three/frame/lights.ts`
|
|
53
64
|
- `src/three/frame/medium.ts`
|
|
54
|
-
- `src/three/frame/neural.ts`
|
|
55
|
-
- `src/three/frame/phase.ts`
|
|
56
65
|
- `src/three/frame/renderer.ts`
|
|
57
|
-
- `src/three/frame/shadow-density-material.ts`
|
|
58
66
|
- `src/three/frame/spectrum.ts`
|
|
59
|
-
- `src/three/frame/
|
|
60
|
-
- `src/three/frame/transmittance-material.ts`
|
|
61
|
-
- `src/three/frame/view.ts`
|
|
62
|
-
- `src/three/frame/volume-shadow-material.ts`
|
|
63
|
-
- `src/three/frame/volume-shadows.ts`
|
|
67
|
+
- `src/three/frame/volume-shadows.ts` (also commits `62a6e3e`, `c13f2d5`)
|
|
64
68
|
- `src/three/frame/volume.ts`
|
|
65
69
|
- `src/three/level-set-material.ts`
|
|
66
70
|
- `src/three/points.ts`
|
|
67
71
|
- `src/three/sparse-source.ts`
|
|
68
72
|
- `src/three/volume-source.ts`
|
|
69
73
|
- `src/tools/cpu/level-set.ts`
|
|
74
|
+
- `src/tools/cpu/points.ts`
|
|
70
75
|
- `src/tools/frame/blackbody.ts`
|
|
71
76
|
- `src/tools/frame/emission.ts`
|
|
77
|
+
- `src/tools/frame/environment-gpu.ts`
|
|
72
78
|
- `src/tools/frame/environment.ts`
|
|
79
|
+
- `src/tools/frame/froxel.ts`
|
|
73
80
|
- `src/tools/frame/grid.ts`
|
|
74
81
|
- `src/tools/frame/index.ts`
|
|
75
82
|
- `src/tools/frame/medium.ts`
|
|
83
|
+
- `src/tools/frame/mie-table.ts` (generated by our port of his table generator, see below)
|
|
76
84
|
- `src/tools/frame/mie.ts`
|
|
85
|
+
- `src/tools/frame/mlp.ts`
|
|
86
|
+
- `src/tools/frame/multi-scale.ts` (commit `4e2d46f`)
|
|
77
87
|
- `src/tools/frame/neural.ts`
|
|
78
88
|
- `src/tools/frame/pyramid-layout.ts`
|
|
79
89
|
- `src/tools/frame/shadows.ts`
|
|
80
90
|
- `src/tools/frame/sparse.ts`
|
|
91
|
+
- `src/tools/frame/spectral-stack.ts`
|
|
81
92
|
- `src/tools/frame/spectral.ts`
|
|
93
|
+
- `src/tools/frame/stack.ts`
|
|
94
|
+
- `src/tools/frame/view.ts`
|
|
82
95
|
- `src/tools/vdb/point-render-data.ts`
|
|
83
96
|
- `src/tools/vdb/points.ts`
|
|
84
97
|
- `src/tools/wvdb/bake.ts`
|
|
85
98
|
- `src/tools/wvdb/dense.ts`
|
|
86
99
|
- `src/tools/wvdb/format.ts`
|
|
100
|
+
- `src/tools/wvdb/index.ts`
|
|
87
101
|
- `src/tools/wvdb/level-set.ts`
|
|
102
|
+
- `src/tools/wvdb/partial.ts`
|
|
88
103
|
- `src/tools/wvdb/read.ts`
|
|
89
104
|
- `src/tools/wvdb/write.ts`
|
|
90
|
-
- `src/tools/frame/neural-weights.ts` (data, see below)
|
|
91
105
|
|
|
92
106
|
`src/tools/frame/mie-table.ts` is the output of our port of his Mie table generator (after Bohren and Huffman's
|
|
93
107
|
BHMIE). The numbers are identical to his tables, but the file is generated, not copied.
|
|
94
108
|
|
|
95
109
|
### Neural indirect-light weights
|
|
96
110
|
|
|
97
|
-
`src/tools/frame/neural-weights.ts` holds the weights of
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
(`VDBFrameRenderer.neuralNetwork`) or leave them out (`null`: `'neural'` then runs as 1D diffusion).
|
|
111
|
+
`src/tools/frame/neural-weights.ts` holds the weights of the default `multipleScattering: 'neural'` network. They are
|
|
112
|
+
ours (MIT): trained by `scripts/k6/neural/` (derived from his training scripts, MIT as above) on procedural media
|
|
113
|
+
generated by our code only; no third-party volume data was read. Swap them with `VDBFrameRenderer.mlp`, or leave them
|
|
114
|
+
out (`null`: `'neural'` then runs as 1D diffusion). His own weights are no longer shipped.
|
|
102
115
|
|
|
103
116
|
## @pmndrs/bvh (MIT)
|
|
104
117
|
|
|
@@ -125,6 +138,142 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
|
|
|
125
138
|
DEALINGS IN THE SOFTWARE.
|
|
126
139
|
```
|
|
127
140
|
|
|
141
|
+
## pmndrs/denoiser (MIT)
|
|
142
|
+
|
|
143
|
+
`src/tools/frame/mlp-tza.ts` reads and writes the `.tza` v2 weight container after `denoiser-core`'s `parseTZA`
|
|
144
|
+
(`packages/denoiser-core/src/tza.ts`), and `src/tools/frame/mlp.ts` (`vdbFrameMlpPack`) lays a dense layer out as
|
|
145
|
+
`denoiser-wgsl`'s `packWeights` / `packBias` do (`packages/denoiser-wgsl/src/conv.ts`, the one-tap case); the core's packed
|
|
146
|
+
MLP evaluator (`src/core/frame/wgsl/lighting.ts`, `mlpRuntime: 'packed'`) follows its `mat4x4 * vec4` layer math. Commit
|
|
147
|
+
`3ad5e98` of https://github.com/pmndrs/denoiser.
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
MIT License
|
|
151
|
+
|
|
152
|
+
Copyright (c) 2024 Dennis Smolek
|
|
153
|
+
|
|
154
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
155
|
+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
|
156
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
|
157
|
+
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
158
|
+
|
|
159
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
|
160
|
+
the Software.
|
|
161
|
+
|
|
162
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
163
|
+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
164
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
165
|
+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
166
|
+
DEALINGS IN THE SOFTWARE.
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Blosc: BloscLZ decoder and LZ4 frame writer (BSD-3-Clause), FastLZ (MIT)
|
|
170
|
+
|
|
171
|
+
The BloscLZ stream decoder in `src/tools/vdb/blosclz.ts` (reads Blosc frames written with the BloscLZ codec, such as
|
|
172
|
+
NVIDIA Warp's `.nvdb` files) is ported from the decoder OpenVDB v14.0.0 vendors
|
|
173
|
+
(`ext/blosc/openvdb/ext/blosc/blosclz.c`, extracted from c-blosc 1.21.6, BloscLZ 2.5.1), which is based on FastLZ.
|
|
174
|
+
The Blosc frame writer in `src/tools/vdb/blosc-write.ts` (`writeNvdb({ codec: 'blosc' })`) is ported from the
|
|
175
|
+
compression half of the Blosc OpenVDB v14.0.0 vendors (`ext/blosc/openvdb/ext/blosc/vdb_blosc.c`, c-blosc 1.21.6).
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
BSD License
|
|
179
|
+
|
|
180
|
+
For Blosc - A blocking, shuffling and lossless compression library
|
|
181
|
+
|
|
182
|
+
Copyright (c) 2009-2018 Francesc Alted <francesc@blosc.org>
|
|
183
|
+
Copyright (c) 2019-present Blosc Development Team <blosc@blosc.org>
|
|
184
|
+
|
|
185
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
186
|
+
are permitted provided that the following conditions are met:
|
|
187
|
+
|
|
188
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
189
|
+
list of conditions and the following disclaimer.
|
|
190
|
+
|
|
191
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
192
|
+
this list of conditions and the following disclaimer in the documentation
|
|
193
|
+
and/or other materials provided with the distribution.
|
|
194
|
+
|
|
195
|
+
* Neither the name Francesc Alted nor the names of its contributors may be used
|
|
196
|
+
to endorse or promote products derived from this software without specific
|
|
197
|
+
prior written permission.
|
|
198
|
+
|
|
199
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
200
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
201
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
202
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
203
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
204
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
205
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
206
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
207
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
208
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
FastLZ - Byte-aligned LZ77 compression library
|
|
213
|
+
Copyright (C) 2005-2020 Ariya Hidayat <ariya.hidayat@gmail.com>
|
|
214
|
+
|
|
215
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
216
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
217
|
+
in the Software without restriction, including without limitation the rights
|
|
218
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
219
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
220
|
+
furnished to do so, subject to the following conditions:
|
|
221
|
+
|
|
222
|
+
The above copyright notice and this permission notice shall be included in
|
|
223
|
+
all copies or substantial portions of the Software.
|
|
224
|
+
|
|
225
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
226
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
227
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
228
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
229
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
230
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
231
|
+
THE SOFTWARE.
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## LZ4 (BSD-2-Clause)
|
|
235
|
+
|
|
236
|
+
The LZ4 block compressor in `src/tools/vdb/lz4.ts` (used by `writeNvdb({ codec: 'blosc' })`) is ported from
|
|
237
|
+
`LZ4_compress_generic` of the LZ4 library OpenVDB v14.0.0 vendors (`ext/blosc/openvdb/ext/blosc/lz4/lz4.c`, LZ4 1.9.4).
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
LZ4 Library
|
|
241
|
+
Copyright (c) 2011-2020, Yann Collet
|
|
242
|
+
All rights reserved.
|
|
243
|
+
|
|
244
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
245
|
+
are permitted provided that the following conditions are met:
|
|
246
|
+
|
|
247
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
248
|
+
list of conditions and the following disclaimer.
|
|
249
|
+
|
|
250
|
+
* Redistributions in binary form must reproduce the above copyright notice, this
|
|
251
|
+
list of conditions and the following disclaimer in the documentation and/or
|
|
252
|
+
other materials provided with the distribution.
|
|
253
|
+
|
|
254
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
255
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
256
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
257
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
258
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
259
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
260
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
261
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
262
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
263
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## three.js (MIT)
|
|
267
|
+
|
|
268
|
+
`src/tools/frame/spectral.ts` re-implements three.js's `getShIrradianceAt` (the L2 spherical-harmonics irradiance of
|
|
269
|
+
a light probe) as an f64 CPU twin used to test the passes. Copyright (c) 2010-2026 three.js authors, MIT. three is a
|
|
270
|
+
peer dependency and is not bundled.
|
|
271
|
+
|
|
272
|
+
`src/three/level-set-physical-material.ts` ports three.js r187's screen-space refraction from
|
|
273
|
+
`src/nodes/functions/PhysicalLightingModel.js` (`getVolumeTransmissionRay`, `applyIorToRoughness`,
|
|
274
|
+
`getTransmissionSample`, `volumeAttenuation`, `getIBLVolumeRefraction`), started at a traced surface's hit instead of
|
|
275
|
+
the mesh position (G13a). Copyright (c) 2010-2026 three.js authors, MIT.
|
|
276
|
+
|
|
128
277
|
## Wyman, Sloan and Shirley, 2013 (published formula)
|
|
129
278
|
|
|
130
279
|
Blackbody emission colours (`vdbCie1931Fit`, `src/tools/frame/blackbody.ts`) use the multi-lobe piecewise Gaussian
|
|
@@ -139,9 +288,28 @@ used; no code or data was copied. The tabulated CIE data (CC BY-SA 4.0) is not p
|
|
|
139
288
|
vendored, extended fork of emcfarlane's WGSL port of NanoVDB's `PNanoVDB.h` (OpenVDB, Apache-2.0). The original
|
|
140
289
|
copyright and attribution are in [vendor/NOTICE](./vendor/NOTICE), the licence text is
|
|
141
290
|
[vendor/LICENSE](./vendor/LICENSE), and every local change is logged in [vendor/VENDOR.md](./vendor/VENDOR.md).
|
|
142
|
-
These files must stay with any redistribution of the WGSL.
|
|
291
|
+
These files must stay with any redistribution of the WGSL. The lean reader (`src/core/wgsl/lean.ts`, `reader: 'lean'`)
|
|
292
|
+
is written for this package but derives its node layout, root key and leaf decoders from the same `PNanoVDB.h`; the
|
|
293
|
+
modules it generates carry the same SPDX banner and the same notice applies.
|
|
294
|
+
|
|
295
|
+
## NanoVDB `math/HalfLite.h` (Apache-2.0; derived from Imath, BSD-3-Clause)
|
|
296
|
+
|
|
297
|
+
`src/tools/nanovdb/half.ts` (`vdbFloatToHalf`, `vdbHalfToFloat`) ports the binary16 conversions of OpenVDB's
|
|
298
|
+
`nanovdb/nanovdb/math/HalfLite.h` (v14.0.0; Copyright Contributors to the OpenVDB Project, Apache-2.0), which derive
|
|
299
|
+
from Imath's `imath_half_to_float` / `imath_float_to_half` (`Imath/half.h`; Copyright Contributors to the OpenEXR
|
|
300
|
+
Project, BSD-3-Clause; primary original authors Florian Kainz and Rod Bogart). The Apache-2.0 text is
|
|
301
|
+
[vendor/LICENSE](./vendor/LICENSE). The BSD-3-Clause terms: redistributions must retain the copyright notice above,
|
|
302
|
+
this list of conditions and the disclaimer; neither the name of the copyright holder nor the names of its contributors
|
|
303
|
+
may be used to endorse or promote products derived from this software without prior written permission; the software
|
|
304
|
+
is provided "as is", without any express or implied warranties, and in no event shall the copyright holder or
|
|
305
|
+
contributors be liable for any damages arising from its use.
|
|
143
306
|
|
|
144
307
|
## fflate (MIT, runtime dependency)
|
|
145
308
|
|
|
146
309
|
[fflate](https://github.com/101arrowz/fflate), Copyright (c) 2023 Arjun Barrett, provides zlib in
|
|
147
310
|
`@pmndrs/vdb/tools`. It is installed as a dependency, not bundled.
|
|
311
|
+
|
|
312
|
+
## @webgpu/types (BSD-3-Clause, runtime dependency)
|
|
313
|
+
|
|
314
|
+
[@webgpu/types](https://github.com/gpuweb/types) provides the `GPUDevice` and related declarations that the shipped
|
|
315
|
+
`.d.ts` files reference. It is installed as a dependency, not bundled.
|
|
@@ -35,7 +35,7 @@ import type { VDBGridPool } from "../pool/pool.js";
|
|
|
35
35
|
import { type VDBReadback } from "./shared.js";
|
|
36
36
|
import { type VDBAtlasFilter, type VDBAtlasFormat } from "../../tools/cpu/compute.js";
|
|
37
37
|
export type { VDBAtlasFilter, VDBAtlasFormat };
|
|
38
|
-
/** Options of {@link
|
|
38
|
+
/** Options of {@link vdbDecodeToAtlas} (v1's, plus `encoder` and `readback`). */
|
|
39
39
|
export interface VDBDecodeToAtlasOptions {
|
|
40
40
|
/** Per-axis output resolution cap (a literal clamp, not a proportional downscale). Default 256. */
|
|
41
41
|
maxDim?: number;
|
|
@@ -63,6 +63,7 @@ export interface VDBDecodeToAtlasOptions {
|
|
|
63
63
|
export interface VDBAtlas {
|
|
64
64
|
/** `dims` product values, x fastest. */
|
|
65
65
|
data: Uint8Array | Float32Array;
|
|
66
|
+
/** Output size per axis in cells (the grid's index box, capped by `maxDim`). */
|
|
66
67
|
dims: [number, number, number];
|
|
67
68
|
/** The range used for normalization (echoed so the caller can undo it). */
|
|
68
69
|
range: {
|
|
@@ -72,7 +73,9 @@ export interface VDBAtlas {
|
|
|
72
73
|
}
|
|
73
74
|
/** The pending atlas: a {@link VDBReadback} plus the GPU output. */
|
|
74
75
|
export interface VDBAtlasReadback extends VDBReadback<VDBAtlas> {
|
|
76
|
+
/** Output size per axis in cells. */
|
|
75
77
|
readonly dims: [number, number, number];
|
|
78
|
+
/** The normalization range (the option, or the grid's root min/max). */
|
|
76
79
|
readonly range: {
|
|
77
80
|
min: number;
|
|
78
81
|
max: number;
|
|
@@ -90,5 +93,10 @@ export interface VDBAtlasReadback extends VDBReadback<VDBAtlas> {
|
|
|
90
93
|
* The grid must be resident and the pool must live on `device` (as for
|
|
91
94
|
* `gridStats`). The tool frees only its own parameter, output and readback
|
|
92
95
|
* buffers.
|
|
96
|
+
*
|
|
97
|
+
* @param device The host's `GPUDevice`; the pool must live on it.
|
|
98
|
+
* @param pool The pool that holds the grid.
|
|
99
|
+
* @param gridId The grid's pool id; it must be resident.
|
|
100
|
+
* @param options Resolution, filter, format, normalization and encoder ({@link VDBDecodeToAtlasOptions}).
|
|
93
101
|
*/
|
|
94
|
-
export declare function
|
|
102
|
+
export declare function vdbDecodeToAtlas(device: GPUDevice, pool: VDBGridPool, gridId: number, options?: VDBDecodeToAtlasOptions): VDBAtlasReadback;
|
|
@@ -52,8 +52,13 @@ function checkAtlasOptions(o) {
|
|
|
52
52
|
* The grid must be resident and the pool must live on `device` (as for
|
|
53
53
|
* `gridStats`). The tool frees only its own parameter, output and readback
|
|
54
54
|
* buffers.
|
|
55
|
+
*
|
|
56
|
+
* @param device The host's `GPUDevice`; the pool must live on it.
|
|
57
|
+
* @param pool The pool that holds the grid.
|
|
58
|
+
* @param gridId The grid's pool id; it must be resident.
|
|
59
|
+
* @param options Resolution, filter, format, normalization and encoder ({@link VDBDecodeToAtlasOptions}).
|
|
55
60
|
*/
|
|
56
|
-
export function
|
|
61
|
+
export function vdbDecodeToAtlas(device, pool, gridId, options = {}) {
|
|
57
62
|
checkAtlasOptions(options);
|
|
58
63
|
const info = checkTarget(WHERE, device, pool, gridId);
|
|
59
64
|
const maxDim = options.maxDim ?? 256;
|