@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 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../src/core/compute/stats.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,iBAAiB,EAC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CAAC,CAAC,CAAE,CAAC;QACrB,KAAK,EAAE,CAAC;QACR,GAAG,IAAI,CAAC,CAAC;QACT,IAAI,CAAC,GAAG,GAAG;YAAE,GAAG,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG;YAAE,GAAG,GAAG,CAAC,CAAC;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9D,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAE,EAAE,CAAC;IAC5D,CAAC;IACD,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IACtH,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC/G,CAAC","sourcesContent":["/**\n * `gridStats`: min, max, mean, active-voxel count and a histogram of one pool\n * grid, as compute passes recorded into the host's encoder (K2.3, ported from\n * v1 `three/compute.ts`). CPU twin: `vdbGridStatsCpu` in `@pmndrs/vdb/tools`.\n *\n * One thread per voxel of the grid's dense index bbox reads `vdbIsActive` and\n * `vdbReadValue`; inactive voxels are skipped. The histogram spans the root\n * statistics `[rootMin, rootMax]` from `pool.info(id)` (v1 read the same f32s\n * on the GPU in a separate pass first).\n *\n * Two paths, as in v1:\n * - root min ≥ 0 (fog volumes): one pass of atomics. `atomicMin/Max` on the\n * value's bit pattern as i32 (order-preserving for non-negative floats),\n * a count, a 64-bit fixed-point sum of `u32(norm * 2^20)` (no f32 atomics\n * in WGSL) and histogram bins. Readback: 3 + bins words + 2.\n * - root min < 0: every voxel's (value, active) is written out and reduced on\n * the CPU after readback (8 B per bbox voxel).\n *\n * Limitations kept from v1: dense bbox dispatch (a sparse grid with a large\n * bbox wastes threads); the range comes from the image's stats, so a grid\n * without stats (or with stale stats after a value transform) bins against\n * whatever they hold; and a negative value in a grid whose root min is ≥ 0\n * (stale stats) breaks the atomics path's min/max.\n */\nimport type { VDBGridPool } from \"../pool/pool.js\";\nimport { VDBError } from \"../errors.js\";\nimport {\n checkPositiveInt,\n checkTarget,\n ComputeJob,\n createInitialized,\n hostEncoder,\n kernelPipeline,\n packParams,\n USAGE,\n workgroups,\n WORKGROUP_AXIS,\n type KernelSource,\n type VDBReadback,\n} from \"./shared.js\";\nimport { bboxSize, GRID_STATS_SUM_SCALE } from \"../../tools/cpu/compute.js\";\n\nconst W = WORKGROUP_AXIS;\n\nconst STATS_FAST: KernelSource = {\n entryPoint: \"csStatsFast\",\n outputs: 2,\n footer: /* wgsl */ `\n@group(1) @binding(0) var<storage, read_write> csStatsI32: array<atomic<i32>>; // [0] min bits, [1] max bits\n@group(1) @binding(1) var<storage, read_write> csStatsU32: array<atomic<u32>>; // [0] count, [1] sum lo, [2] sum hi, [3..] bins\n\nconst CS_SUM_SCALE: f32 = ${GRID_STATS_SUM_SCALE}.0;\n\n@compute @workgroup_size(${W}, ${W}, ${W})\nfn csStatsFast(@builtin(global_invocation_id) gid: vec3u) {\n if any(gid >= csParams.regionSize) {\n return;\n }\n let ijk = csParams.regionMin + vec3i(gid);\n var acc = vdbAccessorInit(csParams.grid);\n if !vdbIsActive(&acc, ijk) {\n return;\n }\n let value = vdbReadValue(&acc, ijk);\n // Non-negative floats keep their order as i32 bit patterns (root min >= 0 was checked on the CPU).\n let bits = bitcast<i32>(value);\n atomicMin(&csStatsI32[0], bits);\n atomicMax(&csStatsI32[1], bits);\n atomicAdd(&csStatsU32[0], 1u);\n let span = max(csParams.range.y - csParams.range.x, 1.0e-20);\n let norm = clamp((value - csParams.range.x) / span, 0.0, 1.0);\n // 64-bit sum: atomicAdd returns the old low word; carry when it wraps.\n let scaled = u32(norm * CS_SUM_SCALE);\n let oldLo = atomicAdd(&csStatsU32[1], scaled);\n if oldLo > (0xFFFFFFFFu - scaled) {\n atomicAdd(&csStatsU32[2], 1u);\n }\n let bins = csParams.bins;\n let bin = min(u32(norm * f32(bins)), bins - 1u);\n atomicAdd(&csStatsU32[3u + bin], 1u);\n}\n`,\n};\n\nconst STATS_DUMP: KernelSource = {\n entryPoint: \"csStatsDump\",\n outputs: 2,\n footer: /* wgsl */ `\n@group(1) @binding(0) var<storage, read_write> csDumpValue: array<f32>;\n@group(1) @binding(1) var<storage, read_write> csDumpIsOn: array<u32>;\n\n@compute @workgroup_size(${W}, ${W}, ${W})\nfn csStatsDump(@builtin(global_invocation_id) gid: vec3u) {\n let size = csParams.regionSize;\n if any(gid >= size) {\n return;\n }\n let idx = gid.x + gid.y * size.x + gid.z * size.x * size.y;\n let ijk = csParams.regionMin + vec3i(gid);\n var acc = vdbAccessorInit(csParams.grid);\n let on = vdbIsActive(&acc, ijk);\n csDumpValue[idx] = vdbReadValue(&acc, ijk);\n csDumpIsOn[idx] = select(0u, 1u, on);\n}\n`,\n};\n\n/** Options of {@link vdbGridStats}. */\nexport interface VDBGridStatsOptions {\n /** Histogram bins over `[rootMin, rootMax]`. Default 256. */\n histogramBins?: number;\n /**\n * Record into this encoder. The host submits it, then calls\n * `job.submitted().read()`; `read()` before `submitted()` rejects\n * (`VDB_BAD_OPTION`). Omitted: the tool creates and submits its own encoder.\n */\n encoder?: GPUCommandEncoder;\n}\n\n/** What {@link vdbGridStats} reads back (v1's `GridStatsResult` plus the range). */\nexport interface VDBGridStats {\n /** Exact extremes over the active voxels (0 when there are none). */\n min: number;\n /** Exact maximum over the active voxels. */\n max: number;\n /** Mean over the active voxels: fixed-point (2^-20 of the range) on the atomics path, f64 on the dump path. */\n mean: number;\n /** `histogramBins` counts over `range`, clamped to the end bins. */\n histogram: Uint32Array;\n /** Number of active voxels counted. */\n activeVoxelCount: number;\n /** True when the atomics path ran (root min ≥ 0). */\n usedAtomicFastPath: boolean;\n /** The histogram range: the grid's root min/max statistics. */\n range: { min: number; max: number };\n}\n\nconst DEFAULT_BINS = 256;\nconst WHERE = \"gridStats\";\n\n/**\n * Records the statistics passes for grid `gridId` of `pool` and returns a\n * {@link VDBReadback}: `await gridStats(device, pool, id).read()`, or with a\n * host encoder `submit`, then `await job.submitted().read()`.\n *\n * The grid must be resident (`pool.update(encoder)` / `pool.flush()` ran\n * after its `add`), and the pool must live on `device`. The tool allocates\n * its own parameter, output and readback buffers and frees them in `read()`\n * or `dispose()`; it never touches the pool's buffer beyond binding it.\n *\n * @param device The host's `GPUDevice`; the pool must live on it.\n * @param pool The pool that holds the grid.\n * @param gridId The grid's pool id; it must be resident.\n * @param options Histogram bins and an optional host encoder ({@link VDBGridStatsOptions}).\n *\n * @throws VDBError `VDB_BAD_OPTION` for bad options, a pool on another\n * device, a non-resident grid, or (root min < 0, the dump path) a bbox whose\n * per-voxel outputs (`voxels * 4` bytes each, `voxels * 8` to read back)\n * exceed `device.limits.maxStorageBufferBindingSize` / `maxBufferSize`.\n */\nexport function vdbGridStats(device: GPUDevice, pool: VDBGridPool, gridId: number, options: VDBGridStatsOptions = {}): VDBReadback<VDBGridStats> {\n const bins = options.histogramBins ?? DEFAULT_BINS;\n checkPositiveInt(WHERE, \"histogramBins\", bins);\n const info = checkTarget(WHERE, device, pool, gridId);\n const range = { min: info.rootMin, max: info.rootMax };\n const regionMin = info.indexBBox.min;\n const size = bboxSize(info.indexBBox);\n const fast = range.min >= 0;\n if (!fast) checkDumpSize(device, gridId, size);\n const kernel = fast ? STATS_FAST : STATS_DUMP;\n const cached = kernelPipeline(device, kernel, info.type);\n\n const params = createInitialized(device, \"vdb gridStats params\", USAGE.UNIFORM, new Uint8Array(packParams({ grid: gridId, bins, regionMin, regionSize: size, range })));\n let outA: GPUBuffer;\n let outB: GPUBuffer;\n const outUsage = USAGE.STORAGE | USAGE.COPY_SRC;\n if (fast) {\n // min starts at i32 max (above every non-negative float's bits), max at +0.0.\n outA = createInitialized(device, \"vdb gridStats min/max\", outUsage, new Int32Array([0x7fffffff, 0]));\n outB = createInitialized(device, \"vdb gridStats sums\", outUsage, new Uint32Array(3 + bins));\n } else {\n const voxels = size[0] * size[1] * size[2];\n outA = device.createBuffer({ label: \"vdb gridStats values\", size: voxels * 4, usage: outUsage });\n outB = device.createBuffer({ label: \"vdb gridStats active\", size: voxels * 4, usage: outUsage });\n }\n const staging = device.createBuffer({ label: \"vdb gridStats readback\", size: outA.size + outB.size, usage: USAGE.MAP_READ | USAGE.COPY_DST });\n\n const group0 = device.createBindGroup({ layout: cached.group0, entries: [pool.bindGroupEntry({ group: 0, firstBinding: 0 }), { binding: 1, resource: { buffer: params } }] });\n const group1 = device.createBindGroup({ layout: cached.group1, entries: [{ binding: 0, resource: { buffer: outA } }, { binding: 1, resource: { buffer: outB } }] });\n\n const host = hostEncoder(device, options.encoder, \"vdb gridStats\");\n const pass = host.encoder.beginComputePass({ label: `vdb gridStats (${fast ? \"atomics\" : \"dump\"})` });\n pass.setPipeline(cached.pipeline);\n pass.setBindGroup(0, group0);\n pass.setBindGroup(1, group1);\n pass.dispatchWorkgroups(...workgroups(size));\n pass.end();\n host.encoder.copyBufferToBuffer(outA, 0, staging, 0, outA.size);\n host.encoder.copyBufferToBuffer(outB, 0, staging, outA.size, outB.size);\n host.submit();\n\n const splitAt = outA.size;\n return new ComputeJob(\n WHERE,\n [params, outA, outB],\n staging,\n cached.error,\n (bytes) => (fast ? reduceFast(bytes, bins, range) : reduceDump(bytes, splitAt, bins, range)),\n host.selfSubmitted,\n );\n}\n\n/**\n * The dump path writes 4 B of value and 4 B of active flag per bbox voxel and\n * reads both back (8 B per voxel); refuse a bbox the device can't hold before\n * any buffer is made.\n */\nfunction checkDumpSize(device: GPUDevice, gridId: number, size: readonly [number, number, number]): void {\n const voxels = size[0] * size[1] * size[2];\n const each = voxels * 4;\n const limits = device.limits as Partial<GPUSupportedLimits> | undefined;\n const binding = limits?.maxStorageBufferBindingSize ?? Infinity;\n const total = limits?.maxBufferSize ?? Infinity;\n if (each > binding || each * 2 > total) {\n throw new VDBError(\n \"VDB_BAD_OPTION\",\n `${WHERE}: grid ${gridId} has a negative root min, so its stats take the dump path (8 B per bbox voxel): ` +\n `${size.join(\" x \")} = ${voxels} voxels needs ${each} B per output binding and ${each * 2} B of readback, over this device's ` +\n `maxStorageBufferBindingSize ${binding} / maxBufferSize ${total}. Raise the limits (VDBGridPool.requiredLimits(adapter)) ` +\n \"or compute the stats on the CPU (vdbGridStatsCpu in @pmndrs/vdb/tools).\",\n );\n }\n}\n\nfunction reduceFast(bytes: ArrayBuffer, bins: number, range: { min: number; max: number }): VDBGridStats {\n const u32 = new Uint32Array(bytes, 8, 3 + bins);\n const count = u32[0]!;\n const histogram = u32.slice(3, 3 + bins);\n if (count === 0) return { min: 0, max: 0, mean: 0, histogram, activeVoxelCount: 0, usedAtomicFastPath: true, range };\n const minMax = new Float32Array(bytes, 0, 2);\n const total = BigInt(u32[2]!) * 4294967296n + BigInt(u32[1]!);\n const meanNorm = Number(total) / (GRID_STATS_SUM_SCALE * count);\n return {\n min: minMax[0]!,\n max: minMax[1]!,\n mean: range.min + meanNorm * (range.max - range.min),\n histogram,\n activeVoxelCount: count,\n usedAtomicFastPath: true,\n range,\n };\n}\n\nfunction reduceDump(bytes: ArrayBuffer, splitAt: number, bins: number, range: { min: number; max: number }): VDBGridStats {\n const values = new Float32Array(bytes, 0, splitAt / 4);\n const on = new Uint32Array(bytes, splitAt, splitAt / 4);\n const histogram = new Uint32Array(bins);\n let min = Infinity;\n let max = -Infinity;\n let sum = 0;\n let count = 0;\n const span = Math.max(range.max - range.min, 1e-20);\n for (let i = 0; i < values.length; i++) {\n if (!on[i]) continue;\n const v = values[i]!;\n count++;\n sum += v;\n if (v < min) min = v;\n if (v > max) max = v;\n const norm = Math.min(Math.max((v - range.min) / span, 0), 1);\n histogram[Math.min(Math.floor(norm * bins), bins - 1)]!++;\n }\n if (count === 0) return { min: 0, max: 0, mean: 0, histogram, activeVoxelCount: 0, usedAtomicFastPath: false, range };\n return { min, max, mean: sum / count, histogram, activeVoxelCount: count, usedAtomicFastPath: false, range };\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { VDBGridPool } from "../pool/pool.js";
|
|
2
|
+
/** A per-value function; the result is rounded to f32. */
|
|
3
|
+
export type VDBValueTransform = (value: number) => number;
|
|
4
|
+
/** Named transforms (v1's `VALUE_TRANSFORM_PRESETS`, as functions). */
|
|
5
|
+
export declare const VDB_VALUE_TRANSFORM_PRESETS: Readonly<Record<"double" | "half" | "negate" | "clamp01", VDBValueTransform>>;
|
|
6
|
+
/** The names of the built-in transforms: `double`, `half`, `negate`, `clamp01`. */
|
|
7
|
+
export type VDBValueTransformPreset = keyof typeof VDB_VALUE_TRANSFORM_PRESETS;
|
|
8
|
+
/**
|
|
9
|
+
* Applies `transform` (a function or a preset name) to every leaf voxel value
|
|
10
|
+
* inside grid `gridId`'s index bbox, and stages the result with
|
|
11
|
+
* `pool.replace(gridId, image)`. Returns the new image (the source is not
|
|
12
|
+
* modified); it reaches the GPU at the next `pool.update` / `pool.flush`, in
|
|
13
|
+
* place (same size, so no `version` change).
|
|
14
|
+
*
|
|
15
|
+
* `sourceImage` is the grid's current image (the pool keeps none); it must be
|
|
16
|
+
* the grid in the pool, which is checked by type, byte size and index bbox.
|
|
17
|
+
*
|
|
18
|
+
* Float and Half grids (Half since K7.H1: results round to f32, then to the
|
|
19
|
+
* nearest binary16); tile and background values are not changed;
|
|
20
|
+
* the image's statistics are not recomputed (they keep describing the source
|
|
21
|
+
* values, so `gridStats` bins against the old range and `vdbNodeMax` bounds
|
|
22
|
+
* may be stale). Like `replace`, the pool holds the returned array until
|
|
23
|
+
* `settled()`; don't reuse it before then.
|
|
24
|
+
*
|
|
25
|
+
* @param pool The pool that holds the grid.
|
|
26
|
+
* @param gridId The grid's pool id.
|
|
27
|
+
* @param sourceImage The grid's current image, as given to `pool.add`.
|
|
28
|
+
* @param transform A per-value function or a preset name.
|
|
29
|
+
*/
|
|
30
|
+
export declare function vdbApplyValueTransform(pool: VDBGridPool, gridId: number, sourceImage: Uint32Array, transform: VDBValueTransform | VDBValueTransformPreset): Uint32Array;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vdbApplyValueTransform`: per-voxel value edits for pool grids (K2.3).
|
|
3
|
+
*
|
|
4
|
+
* Decided for 0.1: the transform runs on the CPU (`transformLeafValues` in
|
|
5
|
+
* `@pmndrs/vdb/tools`) and the result is staged with `pool.replace`. v1 ran a
|
|
6
|
+
* WGSL body on the GPU against a `read_write` copy of the image; the pool binds
|
|
7
|
+
* read-only to every module (D10) and keeps no CPU copy of an image, so the
|
|
8
|
+
* host passes the source image it added.
|
|
9
|
+
*
|
|
10
|
+
* A GPU write path may follow if interactive use needs it (demo 04 on the
|
|
11
|
+
* reference device is the test): copy the image range into a scratch buffer,
|
|
12
|
+
* run the transform with its own `read_write` binding, then a core
|
|
13
|
+
* `pool.replaceFromBuffer(id, buffer, offset)` that copies GPU to GPU in
|
|
14
|
+
* `update`.
|
|
15
|
+
*/
|
|
16
|
+
import { VDBError } from "../errors.js";
|
|
17
|
+
import { transformLeafValues } from "../../tools/cpu/compute.js";
|
|
18
|
+
/** Named transforms (v1's `VALUE_TRANSFORM_PRESETS`, as functions). */
|
|
19
|
+
export const VDB_VALUE_TRANSFORM_PRESETS = Object.freeze({
|
|
20
|
+
double: (v) => v * 2,
|
|
21
|
+
half: (v) => v * 0.5,
|
|
22
|
+
negate: (v) => -v,
|
|
23
|
+
clamp01: (v) => Math.min(Math.max(v, 0), 1),
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Applies `transform` (a function or a preset name) to every leaf voxel value
|
|
27
|
+
* inside grid `gridId`'s index bbox, and stages the result with
|
|
28
|
+
* `pool.replace(gridId, image)`. Returns the new image (the source is not
|
|
29
|
+
* modified); it reaches the GPU at the next `pool.update` / `pool.flush`, in
|
|
30
|
+
* place (same size, so no `version` change).
|
|
31
|
+
*
|
|
32
|
+
* `sourceImage` is the grid's current image (the pool keeps none); it must be
|
|
33
|
+
* the grid in the pool, which is checked by type, byte size and index bbox.
|
|
34
|
+
*
|
|
35
|
+
* Float and Half grids (Half since K7.H1: results round to f32, then to the
|
|
36
|
+
* nearest binary16); tile and background values are not changed;
|
|
37
|
+
* the image's statistics are not recomputed (they keep describing the source
|
|
38
|
+
* values, so `gridStats` bins against the old range and `vdbNodeMax` bounds
|
|
39
|
+
* may be stale). Like `replace`, the pool holds the returned array until
|
|
40
|
+
* `settled()`; don't reuse it before then.
|
|
41
|
+
*
|
|
42
|
+
* @param pool The pool that holds the grid.
|
|
43
|
+
* @param gridId The grid's pool id.
|
|
44
|
+
* @param sourceImage The grid's current image, as given to `pool.add`.
|
|
45
|
+
* @param transform A per-value function or a preset name.
|
|
46
|
+
*/
|
|
47
|
+
export function vdbApplyValueTransform(pool, gridId, sourceImage, transform) {
|
|
48
|
+
const where = "vdbApplyValueTransform";
|
|
49
|
+
const fn = typeof transform === "string" ? VDB_VALUE_TRANSFORM_PRESETS[transform] : transform;
|
|
50
|
+
if (typeof fn !== "function") {
|
|
51
|
+
throw new VDBError("VDB_BAD_OPTION", `${where}: transform must be a function (v) => number or one of ${Object.keys(VDB_VALUE_TRANSFORM_PRESETS).join(", ")}; got ${JSON.stringify(transform)}.`);
|
|
52
|
+
}
|
|
53
|
+
const info = pool.info(gridId);
|
|
54
|
+
if (info.type !== "float" && info.type !== "half") {
|
|
55
|
+
throw new VDBError("VDB_UNSUPPORTED_GRID_TYPE", `${where}: grid ${gridId} is ${info.type}; value transforms need a Float or Half grid (quantized leaves would need re-encoding). Transform the Float source, quantize() it, and pool.replace().`);
|
|
56
|
+
}
|
|
57
|
+
if (!(sourceImage instanceof Uint32Array) || sourceImage.byteLength !== info.imageBytes) {
|
|
58
|
+
throw new VDBError("VDB_BAD_OPTION", `${where}: sourceImage must be grid ${gridId}'s current image (${info.imageBytes} bytes); got ${sourceImage instanceof Uint32Array ? `${sourceImage.byteLength} bytes` : typeof sourceImage}.`);
|
|
59
|
+
}
|
|
60
|
+
const image = transformLeafValues(sourceImage, fn);
|
|
61
|
+
pool.replace(gridId, image);
|
|
62
|
+
return image;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=value-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-transform.js","sourceRoot":"","sources":["../../../src/core/compute/value-transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKjE,uEAAuE;AACvE,MAAM,CAAC,MAAM,2BAA2B,GAAkF,MAAM,CAAC,MAAM,CAAC;IACtI,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG;IAC5B,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC;IACzB,OAAO,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACpD,CAAC,CAAC;AAKH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAiB,EACjB,MAAc,EACd,WAAwB,EACxB,SAAsD;IAEtD,MAAM,KAAK,GAAG,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pool grids (K2.3).\n *\n * Decided for 0.1: the transform runs on the CPU (`transformLeafValues` in\n * `@pmndrs/vdb/tools`) and the result is staged with `pool.replace`. v1 ran a\n * WGSL body on the GPU against a `read_write` copy of the image; the pool binds\n * read-only to every module (D10) and keeps no CPU copy of an image, so the\n * host passes the source image it added.\n *\n * A GPU write path may follow if interactive use needs it (demo 04 on the\n * reference device is the test): copy the image range into a scratch buffer,\n * run the transform with its own `read_write` binding, then a core\n * `pool.replaceFromBuffer(id, buffer, offset)` that copies GPU to GPU in\n * `update`.\n */\nimport { VDBError } from \"../errors.js\";\nimport type { VDBGridPool } from \"../pool/pool.js\";\nimport { transformLeafValues } from \"../../tools/cpu/compute.js\";\n\n/** A per-value function; the result is rounded to f32. */\nexport type VDBValueTransform = (value: number) => number;\n\n/** Named transforms (v1's `VALUE_TRANSFORM_PRESETS`, as functions). */\nexport const VDB_VALUE_TRANSFORM_PRESETS: Readonly<Record<\"double\" | \"half\" | \"negate\" | \"clamp01\", VDBValueTransform>> = Object.freeze({\n double: (v: number) => v * 2,\n half: (v: number) => v * 0.5,\n negate: (v: number) => -v,\n clamp01: (v: number) => Math.min(Math.max(v, 0), 1),\n});\n\n/** The names of the built-in transforms: `double`, `half`, `negate`, `clamp01`. */\nexport type VDBValueTransformPreset = keyof typeof VDB_VALUE_TRANSFORM_PRESETS;\n\n/**\n * Applies `transform` (a function or a preset name) to every leaf voxel value\n * inside grid `gridId`'s index bbox, and stages the result with\n * `pool.replace(gridId, image)`. Returns the new image (the source is not\n * modified); it reaches the GPU at the next `pool.update` / `pool.flush`, in\n * place (same size, so no `version` change).\n *\n * `sourceImage` is the grid's current image (the pool keeps none); it must be\n * the grid in the pool, which is checked by type, byte size and index bbox.\n *\n * Float and Half grids (Half since K7.H1: results round to f32, then to the\n * nearest binary16); tile and background values are not changed;\n * the image's statistics are not recomputed (they keep describing the source\n * values, so `gridStats` bins against the old range and `vdbNodeMax` bounds\n * may be stale). Like `replace`, the pool holds the returned array until\n * `settled()`; don't reuse it before then.\n *\n * @param pool The pool that holds the grid.\n * @param gridId The grid's pool id.\n * @param sourceImage The grid's current image, as given to `pool.add`.\n * @param transform A per-value function or a preset name.\n */\nexport function vdbApplyValueTransform(\n pool: VDBGridPool,\n gridId: number,\n sourceImage: Uint32Array,\n transform: VDBValueTransform | VDBValueTransformPreset,\n): Uint32Array {\n const where = \"vdbApplyValueTransform\";\n const fn = typeof transform === \"string\" ? VDB_VALUE_TRANSFORM_PRESETS[transform] : transform;\n if (typeof fn !== \"function\") {\n throw new VDBError(\n \"VDB_BAD_OPTION\",\n `${where}: transform must be a function (v) => number or one of ${Object.keys(VDB_VALUE_TRANSFORM_PRESETS).join(\", \")}; got ${JSON.stringify(transform)}.`,\n );\n }\n const info = pool.info(gridId);\n if (info.type !== \"float\" && info.type !== \"half\") {\n throw new VDBError(\n \"VDB_UNSUPPORTED_GRID_TYPE\",\n `${where}: grid ${gridId} is ${info.type}; value transforms need a Float or Half grid (quantized leaves would need re-encoding). Transform the Float source, quantize() it, and pool.replace().`,\n );\n }\n if (!(sourceImage instanceof Uint32Array) || sourceImage.byteLength !== info.imageBytes) {\n throw new VDBError(\n \"VDB_BAD_OPTION\",\n `${where}: sourceImage must be grid ${gridId}'s current image (${info.imageBytes} bytes); got ${sourceImage instanceof Uint32Array ? `${sourceImage.byteLength} bytes` : typeof sourceImage}.`,\n );\n }\n const image = transformLeafValues(sourceImage, fn);\n pool.replace(gridId, image);\n return image;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error type for the engine-free core (docs/dev/design/K1-core.md §4).
|
|
3
|
+
* Every message should say what to do next.
|
|
4
|
+
*/
|
|
5
|
+
export type VDBErrorCode = "VDB_UNSUPPORTED_DEVICE" | "VDB_BAD_IMAGE" | "VDB_UNSUPPORTED_GRID_TYPE" | "VDB_POOL_LIMIT" | "VDB_POOL_FULL" | "VDB_UNKNOWN_GRID" | "VDB_NO_STATS" | "VDB_TYPE_NOT_COMPILED" | "VDB_LAYOUT_MISMATCH" | "VDB_BAD_OPTION" | "VDB_DISPOSED"
|
|
6
|
+
/** User WGSL (the frame renderer's emission colour hook) failed validation; the message names the line. */
|
|
7
|
+
| "VDB_BAD_WGSL"
|
|
8
|
+
/** An engine adapter found the engine's internals not behaving as the adapter expects (e.g. a renderer version it wasn't built for). */
|
|
9
|
+
| "VDB_ENGINE_MISMATCH";
|
|
10
|
+
/** The error every core API throws, with a machine-readable {@link VDBErrorCode} in `code`. */
|
|
11
|
+
export declare class VDBError extends Error {
|
|
12
|
+
/** The error kind; the message is prefixed with it. */
|
|
13
|
+
readonly code: VDBErrorCode;
|
|
14
|
+
/**
|
|
15
|
+
* Creates the error; the message is prefixed with `@pmndrs/vdb [code]`.
|
|
16
|
+
*
|
|
17
|
+
* @param code The error kind.
|
|
18
|
+
* @param message What went wrong and how to fix it.
|
|
19
|
+
*/
|
|
20
|
+
constructor(code: VDBErrorCode, message: string);
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** The error every core API throws, with a machine-readable {@link VDBErrorCode} in `code`. */
|
|
2
|
+
export class VDBError extends Error {
|
|
3
|
+
/** The error kind; the message is prefixed with it. */
|
|
4
|
+
code;
|
|
5
|
+
/**
|
|
6
|
+
* Creates the error; the message is prefixed with `@pmndrs/vdb [code]`.
|
|
7
|
+
*
|
|
8
|
+
* @param code The error kind.
|
|
9
|
+
* @param message What went wrong and how to fix it.
|
|
10
|
+
*/
|
|
11
|
+
constructor(code, message) {
|
|
12
|
+
super(`@pmndrs/vdb [${code}]: ${message}`);
|
|
13
|
+
this.name = "VDBError";
|
|
14
|
+
this.code = code;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAqBA,+FAA+F;AAC/F,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,uDAAuD;IAC9C,IAAI,CAAe;IAE5B;;;;;OAKG;IACH,YAAY,IAAkB,EAAE,OAAe;QAC7C,KAAK,CAAC,gBAAgB,IAAI,MAAM,OAAO,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF","sourcesContent":["/**\n * Error type for the engine-free core (docs/dev/design/K1-core.md §4).\n * Every message should say what to do next.\n */\nexport type VDBErrorCode =\n | \"VDB_UNSUPPORTED_DEVICE\"\n | \"VDB_BAD_IMAGE\"\n | \"VDB_UNSUPPORTED_GRID_TYPE\"\n | \"VDB_POOL_LIMIT\"\n | \"VDB_POOL_FULL\"\n | \"VDB_UNKNOWN_GRID\"\n | \"VDB_NO_STATS\"\n | \"VDB_TYPE_NOT_COMPILED\"\n | \"VDB_LAYOUT_MISMATCH\"\n | \"VDB_BAD_OPTION\"\n | \"VDB_DISPOSED\"\n /** User WGSL (the frame renderer's emission colour hook) failed validation; the message names the line. */\n | \"VDB_BAD_WGSL\"\n /** An engine adapter found the engine's internals not behaving as the adapter expects (e.g. a renderer version it wasn't built for). */\n | \"VDB_ENGINE_MISMATCH\";\n\n/** The error every core API throws, with a machine-readable {@link VDBErrorCode} in `code`. */\nexport class VDBError extends Error {\n /** The error kind; the message is prefixed with it. */\n readonly code: VDBErrorCode;\n\n /**\n * Creates the error; the message is prefixed with `@pmndrs/vdb [code]`.\n *\n * @param code The error kind.\n * @param message What went wrong and how to fix it.\n */\n constructor(code: VDBErrorCode, message: string) {\n super(`@pmndrs/vdb [${code}]: ${message}`);\n this.name = \"VDBError\";\n this.code = code;\n }\n}\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type VDBRetireQueue } from "./resources.js";
|
|
2
|
+
import type { VDBEmissionColor, VDBFrameEmissionLightSettings, VDBFrameEmissionProbes } from "./types.js";
|
|
3
|
+
type V3 = [number, number, number];
|
|
4
|
+
/**
|
|
5
|
+
* Static checks of a user emission hook (design §3.8): it defines `fn vdbUserEmissionColor(`, every top-level name
|
|
6
|
+
* starts with `vdbUser`, no reserved word is a name, no back-ticks, no bindings, entry points or directives.
|
|
7
|
+
* Returns the first problem with its line, or null.
|
|
8
|
+
*/
|
|
9
|
+
export declare function vdbEmissionHookProblems(wgsl: string): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Validates a user emission hook on `device` once (cached per text): {@link vdbEmissionHookProblems}, then
|
|
12
|
+
* `createShaderModule` + `getCompilationInfo` under `pushErrorScope('validation')` with a test entry that calls
|
|
13
|
+
* `vdbUserEmissionColor(0.5, 1000.0)` as a `vec3f`.
|
|
14
|
+
*
|
|
15
|
+
* @throws VDBError `VDB_BAD_WGSL` naming the line (of the hook text).
|
|
16
|
+
*/
|
|
17
|
+
export declare function vdbValidateEmissionHook(device: GPUDevice, wgsl: string): Promise<void>;
|
|
18
|
+
/** The colour code of a volume: (mode, row) and the hook text when the mode is the hook. */
|
|
19
|
+
export interface VDBEmissionColorCode {
|
|
20
|
+
readonly code: number;
|
|
21
|
+
readonly hook: string | null;
|
|
22
|
+
}
|
|
23
|
+
/** The emission colour LUT texture (rgba32float, 256 × rows) and the hooks of one renderer. */
|
|
24
|
+
export declare class VDBFrameEmissionColors {
|
|
25
|
+
#private;
|
|
26
|
+
/** +1 when `texture` is a new object (rebuild bind groups). */
|
|
27
|
+
version: number;
|
|
28
|
+
constructor(device: GPUDevice, label: string, retire: VDBRetireQueue);
|
|
29
|
+
/** The LUT texture after this update's new rows (uploaded here). */
|
|
30
|
+
texture(): GPUTexture;
|
|
31
|
+
/**
|
|
32
|
+
* The record code of a colour (registers a LUT row, starts a hook's validation). A hook still validating draws white
|
|
33
|
+
* this frame (an invalid pipeline would invalidate the host's command buffer); a failed one throws.
|
|
34
|
+
*/
|
|
35
|
+
codeOf(color: VDBEmissionColor | undefined): VDBEmissionColorCode;
|
|
36
|
+
/** Waits for every hook seen so far to validate (`prepare()`); throws the first failure. */
|
|
37
|
+
settled(colors?: readonly (VDBEmissionColor | undefined)[]): Promise<void>;
|
|
38
|
+
dispose(): void;
|
|
39
|
+
}
|
|
40
|
+
/** One emitting volume of an update (a volume record with an emission channel that is drawn). */
|
|
41
|
+
export interface VDBFrameEmitterInput {
|
|
42
|
+
/** The volume record index this update. */
|
|
43
|
+
readonly record: number;
|
|
44
|
+
/** The record's source group index (direction passes run per source group). */
|
|
45
|
+
readonly group: number;
|
|
46
|
+
/** Unit box → world. */
|
|
47
|
+
readonly matrixWorld: ArrayLike<number>;
|
|
48
|
+
/** Changes when the volume's direction pass would draw differently. */
|
|
49
|
+
readonly key: string;
|
|
50
|
+
}
|
|
51
|
+
/** The probe work of one update. */
|
|
52
|
+
export interface VDBFrameEmissionPlan {
|
|
53
|
+
/** Per source group index: its segment of the emitter list and the count of its changed emitters (direction passes). */
|
|
54
|
+
readonly groups: ReadonlyMap<number, {
|
|
55
|
+
segment: number;
|
|
56
|
+
count: number;
|
|
57
|
+
}>;
|
|
58
|
+
readonly reduce: boolean;
|
|
59
|
+
readonly probes: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** The emission probes of one renderer (his `FrameEmissionLight`, one per renderer; its `outputs` are `VDBFrameEmissionProbes`). */
|
|
62
|
+
export declare class VDBFrameEmissionProbeSet {
|
|
63
|
+
#private;
|
|
64
|
+
/** The renderer's `outputs.emissionProbes` (null until an update with emitters and an emission light). */
|
|
65
|
+
outputs: {
|
|
66
|
+
-readonly [K in keyof VDBFrameEmissionProbes]: VDBFrameEmissionProbes[K];
|
|
67
|
+
} | null;
|
|
68
|
+
/** +1 when a probe texture or buffer is a new object. */
|
|
69
|
+
version: number;
|
|
70
|
+
constructor(device: GPUDevice, label: string, retire: VDBRetireQueue);
|
|
71
|
+
get listBuffer(): GPUBuffer;
|
|
72
|
+
get gridBuffer(): GPUBuffer;
|
|
73
|
+
get directionTexture(): GPUTexture | null;
|
|
74
|
+
get emitterTexture(): GPUTexture | null;
|
|
75
|
+
get probeTexture(): GPUTexture | null;
|
|
76
|
+
/** Slots of the direction and emitter textures (rows). */
|
|
77
|
+
get slots(): number;
|
|
78
|
+
/**
|
|
79
|
+
* His prepareProbes + updateProbeGrid: the emitters' slots and keys, the probe cascades around the emitters and the
|
|
80
|
+
* camera; writes the emitter list and the grid. Returns null when nothing is drawn this update.
|
|
81
|
+
*/
|
|
82
|
+
plan(settings: VDBFrameEmissionLightSettings | null | undefined, emitters: readonly VDBFrameEmitterInput[], cameraPosition: V3, steps: number): VDBFrameEmissionPlan | null;
|
|
83
|
+
dispose(): void;
|
|
84
|
+
}
|
|
85
|
+
export {};
|