@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":"stack.js","sourceRoot":"","sources":["../../../src/tools/frame/stack.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,kHAAkH;AAClH,mFAAmF;AACnF,4GAA4G;AAC5G,kHAAkH;AAClH,4GAA4G;AAE5G;;;;;;GAMG;AAEH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AAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YACvH,CAAC,CAAC,mBAAmB,CAAC,2BAA2B,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACxG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,GAAG,KAAK,CAAC;IACnF,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjG,CAAC","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/frameShaderChunks.js L1061–1194 (createGridNodes: sampleTiles, sampleShadows),\n// FrameShadowDensityMaterial.js L111–155 (the shadow density pass at one voxel).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: stacked 3D textures instead of his 2D slice atlases (K6.2, design §3.2): the layout of the sub-volumes\n// and the hardware trilinear sample of one, as f64 CPU twins of the core kernels. Divergences: DIVERGES.md.\n\n/**\n * Stacked 3D textures of the core frame renderer (K6.2, design §3.2): several logical R³ grids (cascades × targets)\n * are sub-volumes of one 3D texture, tiled along z, then x, then y within the device's `maxTextureDimension3D`. A\n * read clamps the coordinate to the sub-volume's half-texel box, which equals clamp-to-edge per sub-volume and is his\n * `sampleTiles` (bilinear in a slice, linear between slices, both clamped). The core imports the layout; the\n * `k6-core` harness compares the kernels against these twins.\n */\n\nimport { vdbFrameFindCascade, vdbFrameGridMarch, vdbFrameGridUvw, vdbFrameIsotropicDiffusion, type VDBFrameGridLayout, type VDBFrameShadowLight } from \"./grid.js\";\nimport {\n vdbFrameNoise,\n vdbFrameOctavesOff,\n vdbFrameShadowAbsorption,\n vdbFrameShadowDepth,\n vdbFrameShadowMarchDepth,\n vdbFrameShadowStep,\n vdbFrameShadowTotal,\n vdbFrameShadowTransmittance,\n vdbFrameTwoSidedDiffusion,\n type Vec2,\n type Vec3,\n type Vec4,\n} from \"./index.js\";\nimport { vdbFrameOccludedTotal } from \"./occluders.js\";\nimport { vdbFrameAmbientDipole, vdbFrameAmbientPairTotals, vdbFrameAmbientVisibility } from \"./ambient.js\";\n\n/** Where the sub-volumes of a stack sit. */\nexport interface VDBFrameStackLayout {\n /** The 3D texture's size in texels. */\n readonly size: [number, number, number];\n /** Texel origin of each sub-volume, in order. */\n readonly origins: [number, number, number][];\n}\n\n/**\n * The layout of `count` cubes of `side` texels in one 3D texture: along z first (as many as fit in\n * `maxDimension`), then further columns along x, then rows along y. Throws when they do not fit.\n */\nexport function vdbFrameStackLayout(side: number, count: number, maxDimension = 2048): VDBFrameStackLayout {\n const perAxis = Math.floor(maxDimension / side);\n if (perAxis < 1 || count > perAxis * perAxis * perAxis) throw new RangeError(`vdbFrameStackLayout: ${count} sub-volumes of ${side}³ do not fit ${maxDimension}³`);\n const alongZ = Math.min(count, perAxis);\n const columns = Math.min(Math.ceil(count / alongZ), perAxis);\n const rows = Math.ceil(count / (alongZ * columns));\n const origins: [number, number, number][] = [];\n for (let i = 0; i < count; i++) {\n const z = i % alongZ;\n const x = Math.floor(i / alongZ) % columns;\n const y = Math.floor(i / (alongZ * columns));\n origins.push([x * side, y * side, z * side]);\n }\n return { size: [columns * side, rows * side, alongZ * side], origins };\n}\n\n/** A read-back 3D texture: `data` is `channels` values per texel, x fastest, then y, then z. */\nexport interface VDBFrameTexture3d {\n readonly data: ArrayLike<number>;\n readonly size: readonly [number, number, number];\n readonly channels: number;\n}\n\n/** Hardware trilinear filtering (texel centres at i + ½, clamp to edge) of a 3D texture at texel coordinates `p`. */\nexport function vdbFrameTrilinear(t: VDBFrameTexture3d, p: readonly number[]): number[] {\n const [W, H, D] = t.size;\n const f = [p[0]! - 0.5, p[1]! - 0.5, p[2]! - 0.5];\n const i0 = f.map(Math.floor);\n const w = f.map((v, a) => v - i0[a]!);\n const cl = (i: number, n: number) => Math.min(Math.max(i, 0), n - 1);\n const out = new Array<number>(t.channels).fill(0);\n for (let k = 0; k < 8; k++) {\n const dx = k & 1;\n const dy = (k >> 1) & 1;\n const dz = (k >> 2) & 1;\n const weight = (dx ? w[0]! : 1 - w[0]!) * (dy ? w[1]! : 1 - w[1]!) * (dz ? w[2]! : 1 - w[2]!);\n if (weight === 0) continue;\n const at = (cl(i0[0]! + dx, W) + (cl(i0[1]! + dy, H) + cl(i0[2]! + dz, D) * H) * W) * t.channels;\n for (let c = 0; c < t.channels; c++) out[c]! += t.data[at + c]! * weight;\n }\n return out;\n}\n\n/** `vdbFrameStackSample`: the sub-volume at `origin` (side `side`) at `uvw`, clamped to its half-texel box. */\nexport function vdbFrameStackSample(t: VDBFrameTexture3d, origin: readonly number[], side: number, uvw: readonly number[]): number[] {\n return vdbFrameTrilinear(\n t,\n [0, 1, 2].map((a) => origin[a]! + Math.min(Math.max(uvw[a]! * side, 0.5), side - 0.5)),\n );\n}\n\n/** His grid atlas pixel of a voxel (the jitter noise coordinate): tile `cascade · R + z` of `columns` columns. */\nexport function vdbFrameGridFragCoord(resolution: number, columns: number, cascade: number, cell: Vec3): Vec2 {\n const tile = cascade * resolution + cell[2];\n return [(tile % columns) * resolution + cell[0] + 0.5, Math.floor(tile / columns) * resolution + cell[1] + 0.5];\n}\n\n/** The world position of grid voxel `cell` of `cascade` (his getGridCell + gridMin + uvw · gridSize). */\nexport function vdbFrameGridVoxelWorld(grid: VDBFrameGridLayout, cascade: number, cell: Vec3): Vec3 {\n const m = grid.gridMin[cascade]!;\n const s = grid.gridSize[cascade]!;\n const r = grid.resolution;\n return [m[0] + ((cell[0] + 0.5) / r) * s[0], m[1] + ((cell[1] + 0.5) / r) * s[1], m[2] + ((cell[2] + 0.5) / r) * s[2]];\n}\n\n/** One shadow caster as the shadow density pass reads it. */\nexport interface VDBFrameGridCaster {\n /** World → the local unit box (column-major). */\n readonly worldToLocal: ArrayLike<number>;\n /** The source's largest texel count (getLod) and the volume's max world scale. */\n readonly maxTexels: number;\n readonly worldScale: number;\n /** The volume reads mip levels (else level 0). */\n readonly mipmaps: boolean;\n readonly absorbance: number;\n /** sampleExtinction (extinction per world unit) and sampleAlbedo at a local position and lod. */\n extinctionAt(local: Vec3, lod: number): number;\n albedoAt(local: Vec3, lod: number): Vec3;\n}\n\n/**\n * The shadow density pass at one voxel (`vdbFrameGridDensityCs`): the summed (extinction, absorption) of the casters\n * whose unit box holds the voxel centre, each read at the voxel's lod (`voxelSize` = the cascade's largest voxel side).\n */\nexport function vdbFrameGridDensityVoxel(world: Vec3, voxelSize: number, casters: readonly VDBFrameGridCaster[]): Vec2 {\n let extinction = 0;\n let absorption = 0;\n for (const c of casters) {\n const m = c.worldToLocal;\n const local = [0, 1, 2].map((r) => m[r]! * world[0] + m[4 + r]! * world[1] + m[8 + r]! * world[2] + m[12 + r]!) as Vec3;\n if (Math.max(Math.abs(local[0]), Math.abs(local[1]), Math.abs(local[2])) > 0.5) continue;\n const lod = Math.max(0, Math.log2((voxelSize / c.worldScale) * c.maxTexels));\n const readLod = c.mipmaps ? lod : 0;\n const e = c.extinctionAt(local, readLod) * c.absorbance;\n if (!(e > 0)) continue;\n extinction += e;\n absorption += vdbFrameShadowAbsorption(e, c.albedoAt(local, readLod));\n }\n return [extinction, absorption];\n}\n\n/** K6.3: the multiple scattering terms of {@link vdbFrameTransmittanceVoxel3d} beyond the diffusion value. */\nexport interface VDBFrameTransmittanceModes3d {\n /** `getFrameScatteringOctaves` (count 0: off). */\n octaves?: Vec4;\n /** 'two-sided': each slot also marches away from the light (frameTwoSidedDiffusion). */\n twoSided?: boolean;\n /**\n * 'mlp' / 'multi-scale': a slot's total from its direct transmittance, the voxel's world position, the unit direction\n * to the light, the direct optical depth and the march length (e.g. direct + `vdbFrameMlpForward(...)`).\n */\n slotTotal?: ((direct: number, world: Vec3, direction: Vec3, opticalDepth: number, maxDistance: number) => number) | null;\n /**\n * K6.Q1 shadowed ambient: the pairs' upper directions (`vdbFrameAmbientDirections`; [0] the sky direction): the\n * fourth target's z, w become the hemispherical visibilities (V up, V down). Default none (1, 1).\n */\n ambientDirections?: readonly Vec3[] | null;\n /**\n * K6.Q1d ('frame' lighting's `ambientPhase: 'dipole'`, while read): M⁺ / 2 of the directions (`vdbFrameAmbientDipoleMatrix`, row-major): the\n * result's `dipole` is the fifth target, the pairs' dipole b (xyz, w 0; 0 where no extinction is near). Needs\n * `ambientDirections`. Default none.\n */\n ambientDipole?: readonly number[] | null;\n /**\n * K7.15 (his VDB-167): false when nothing reads the sky up / down totals (no probe, hemisphere light or 'outward'\n * environment, no AO pairs): the first target's x, y stay 1, unmarched. Default true. Ignored with\n * `ambientDirections` (pair 0 is the sky marches), as the kernel.\n */\n skyMarch?: boolean;\n}\n\n/** The grey transmittance targets of one voxel; K6.Q1d: `dipole`, the fifth target, with `modes.ambientDipole`. */\nexport type VDBFrameTransmittanceTargets3d = [Vec4, Vec4, Vec4, Vec4] & { dipole?: Vec4 };\n\n/**\n * The transmittance pass (grey) at voxel `cell` of `cascade`, through a grid sampled by `gridAt(cascade, uvw)`\n * ((extinction, absorption) of that cascade): the 4 targets of `vdbFrameTransmittanceCs`. `lights` are the slots\n * (≤ 6), `jitter` the frame's (< 0: off); the noise reads his grid atlas pixel. K6.3 `modes`: octaves, two-sided and\n * the slot total of 'mlp' / 'multi-scale'.\n */\nexport function vdbFrameTransmittanceVoxel3d(\n gridAt: (cascade: number, uvw: Vec3) => Vec2,\n grid: VDBFrameGridLayout,\n cascade: number,\n cell: Vec3,\n lights: readonly VDBFrameShadowLight[],\n skyDirection: Vec3,\n multipleScattering: number,\n jitter: number,\n visibility: ((slot: number, world: Vec3) => number) | null = null,\n modes: VDBFrameTransmittanceModes3d = {},\n): VDBFrameTransmittanceTargets3d {\n const out: VDBFrameTransmittanceTargets3d = [\n [1, 1, 1, 1],\n [1, 1, 1, 1],\n [1, 1, 1, 1],\n [1, 1, 1, 1],\n ];\n const dipoleOn = !!modes.ambientDipole && !!modes.ambientDirections && modes.ambientDirections.length > 0;\n if (dipoleOn) out.dipole = [0, 0, 0, 0];\n const world = vdbFrameGridVoxelWorld(grid, cascade, cell);\n const voxel = grid.gridVoxel[cascade]!;\n const extinctionAt = (p: Vec3): Vec2 => {\n const c = vdbFrameFindCascade(grid, p, 0);\n return c < 0 ? [0, 0] : gridAt(c, vdbFrameGridUvw(grid, c, p));\n };\n let near = 0;\n for (let i = 0; i < 8; i++) {\n const c: Vec3 = [(i & 1) - 0.5, ((i >> 1) & 1) - 0.5, ((i >> 2) & 1) - 0.5];\n near += extinctionAt([world[0] + c[0] * voxel[0], world[1] + c[1] * voxel[1], world[2] + c[2] * voxel[2]])[0];\n }\n if (!(near > 0)) return out;\n const noise = vdbFrameNoise(jitter, vdbFrameGridFragCoord(grid.resolution, grid.columns, cascade, cell));\n const n = (v: Vec3): Vec3 => {\n const l = Math.hypot(v[0], v[1], v[2]);\n return l > 0 ? [v[0] / l, v[1] / l, v[2] / l] : [0, 0, 0];\n };\n const sky = n(skyDirection);\n const octaves = modes.octaves ?? vdbFrameOctavesOff;\n const slot = (i: number): Vec4 => {\n if (i >= lights.length) return [1, 1, 0, 0];\n const l = lights[i]!;\n const isDirection = l[3] < 1.5;\n const toLight: Vec3 = [l[0] - world[0], l[1] - world[1], l[2] - world[2]];\n const dir = isDirection ? n([l[0], l[1], l[2]]) : n(toLight);\n const maxDistance = isDirection ? 1e20 : Math.hypot(...toLight);\n const optical = { opticalDepth: 0 };\n const r = vdbFrameGridMarch(extinctionAt, grid, world, dir, maxDistance, noise, multipleScattering, octaves, optical);\n // K6.3 'two-sided': the slab between the light side and the far side\n if (modes.twoSided) r[1] = vdbFrameTwoSidedDiffusion(r[0], r[2], r[3], vdbFrameGridMarch(extinctionAt, grid, world, [-dir[0], -dir[1], -dir[2]], 1e20, noise, multipleScattering, octaves)[2]);\n // K6.3 'mlp' / 'multi-scale': the total from the direct transmittance\n if (modes.slotTotal) r[1] = modes.slotTotal(r[0], world, dir, optical.opticalDepth, maxDistance);\n return r;\n };\n const ls = [0, 1, 2, 3, 4, 5].map(slot);\n // K6.5b: a host occluder map scales the slot's scattered part by the voxel's visibility (the direct stays unoccluded),\n // after the K6.3 mode's own total; octaves keep 1 / (1 + depth) (the gather occludes their light)\n if (visibility && !(octaves[0] > 0)) {\n for (let i = 0; i < Math.min(lights.length, 6); i++) {\n const s = ls[i]!;\n s[1] = vdbFrameOccludedTotal(s[0], s[1], visibility(i, world));\n }\n }\n // K7.15: the sky marches only when something reads them (the AO pairs read pair 0 from them)\n const dirs = modes.ambientDirections;\n const skyMarch = modes.skyMarch !== false || (!!dirs && dirs.length > 0);\n const unmarched: Vec4 = [1, 1, 0, 0];\n const up = skyMarch ? vdbFrameGridMarch(extinctionAt, grid, world, sky, 1e20, noise, multipleScattering, octaves) : unmarched;\n const down = skyMarch ? vdbFrameGridMarch(extinctionAt, grid, world, [-sky[0], -sky[1], -sky[2]], 1e20, noise, multipleScattering, octaves) : unmarched;\n const skyTotal = (f: Vec4, b: Vec4) => (multipleScattering > 0 && skyMarch ? vdbFrameIsotropicDiffusion(f[2], b[2], f[3]) : f[1]);\n out[0] = [skyTotal(up, down), skyTotal(down, up), ls[0]![1], ls[1]![1]];\n out[1] = [ls[2]![1], ls[3]![1], ls[4]![1], ls[5]![1]];\n out[2] = [ls[0]![0], ls[1]![0], ls[2]![0], ls[3]![0]];\n out[3] = [ls[4]![0], ls[5]![0], 1, 1];\n // K6.Q1: each pair's isotropic-light totals (pair 0: the sky up / down marches), averaged per side\n if (dirs && dirs.length > 0) {\n const totals = dirs.map((d, k) => {\n const front = k === 0 ? up : vdbFrameGridMarch(extinctionAt, grid, world, d, 1e20, noise, multipleScattering, octaves);\n const back = k === 0 ? down : vdbFrameGridMarch(extinctionAt, grid, world, [-d[0], -d[1], -d[2]], 1e20, noise, multipleScattering, octaves);\n return vdbFrameAmbientPairTotals(front, back, multipleScattering > 0, octaves);\n });\n const v = vdbFrameAmbientVisibility(totals);\n out[3][2] = v[0];\n out[3][3] = v[1];\n // K6.Q1d: the pairs' dipole b\n if (dipoleOn) out.dipole = [...vdbFrameAmbientDipole(totals, dirs, modes.ambientDipole!), 0];\n }\n return out;\n}\n\n\n\nconst smoothstep = (e0: number, e1: number, x: number) => {\n const t = Math.min(Math.max((x - e0) / (e1 - e0), 0), 1);\n return t * t * (3 - 2 * t);\n};\n\n/**\n * K6.Q1d: one stacked target at a world position (`targetAt(cascade, uvw)`; the dipole: `vdbFrameStackDipole`), blended\n * toward the next cascade as {@link vdbFrameStackShadows}; `outside` outside the grid.\n */\nexport function vdbFrameStackTarget(targetAt: (cascade: number, uvw: Vec3) => number[], grid: VDBFrameGridLayout, world: Vec3, outside: readonly number[]): number[] {\n const cascade = vdbFrameFindCascade(grid, world, 0);\n if (cascade < 0) return [...outside];\n const uvw = vdbFrameGridUvw(grid, cascade, world);\n let out = targetAt(cascade, uvw);\n const side = Math.min(uvw[0], uvw[1], uvw[2], 1 - uvw[0], 1 - uvw[1], 1 - uvw[2]);\n const blend = 1 - smoothstep(0, 0.1, side);\n if (blend > 0) {\n const next = vdbFrameFindCascade(grid, world, cascade + 1);\n if (next >= 0) {\n const v = targetAt(next, vdbFrameGridUvw(grid, next, world));\n out = out.map((x, c) => x + (v[c]! - x) * blend);\n }\n }\n return out;\n}\n/**\n * sampleShadows on a stacked transmittance texture: the 4 targets at a world position (`targetAt(cascade, k, uvw)`),\n * 1 outside the grid, blended toward the next cascade within 10% of a cascade's sides.\n */\nexport function vdbFrameStackShadows(targetAt: (cascade: number, k: number, uvw: Vec3) => number[], grid: VDBFrameGridLayout, world: Vec3): number[][] {\n const out = [0, 1, 2, 3].map(() => [1, 1, 1, 1]);\n const cascade = vdbFrameFindCascade(grid, world, 0);\n if (cascade < 0) return out;\n const uvw = vdbFrameGridUvw(grid, cascade, world);\n for (let k = 0; k < 4; k++) out[k] = targetAt(cascade, k, uvw);\n const side = Math.min(uvw[0], uvw[1], uvw[2], 1 - uvw[0], 1 - uvw[1], 1 - uvw[2]);\n const blend = 1 - smoothstep(0, 0.1, side);\n if (blend > 0) {\n const next = vdbFrameFindCascade(grid, world, cascade + 1);\n if (next >= 0) {\n const nextUvw = vdbFrameGridUvw(grid, next, world);\n for (let k = 0; k < 4; k++) {\n const v = targetAt(next, k, nextUvw);\n out[k] = out[k]!.map((x, c) => x + (v[c]! - x) * blend);\n }\n }\n }\n return out;\n}\n\n/**\n * The environment grid pass (grey; K6.2b) at voxel `cell` of the last cascade, through a grid sampled by\n * `gridAt(cascade, uvw)`: `unshadowed` (the colour sum of `lights`, ≥ 0) where no extinction is within half a voxel,\n * else Σ colour × total of one-voxel-step marches that stay in the last cascade (with diffusion the two-sided total of\n * the march and the opposite one), ≥ 0. His FrameEnvironmentGridMaterial on a 3D grid. K6.3 `octaves`: the march\n * stops at the last octave's depth, totals are octave sums, and the unshadowed light gets the octave total of 1.\n */\nexport function vdbFrameEnvironmentGridVoxel3d(\n gridAt: (cascade: number, uvw: Vec3) => Vec2,\n grid: VDBFrameGridLayout,\n cell: Vec3,\n lights: readonly { direction: Vec3; color: Vec3 }[],\n multipleScattering: number,\n octaves: Vec4 = vdbFrameOctavesOff,\n): Vec4 {\n const cascade = grid.count - 1;\n const world = vdbFrameGridVoxelWorld(grid, cascade, cell);\n const voxel = grid.gridVoxel[cascade]!;\n const uvwOf = (p: Vec3) => vdbFrameGridUvw(grid, cascade, p);\n const unshadowed: Vec3 = [0, 0, 0];\n for (const l of lights) for (let c = 0; c < 3; c++) unshadowed[c] = unshadowed[c]! + l.color[c]!;\n let near = 0;\n for (let i = 0; i < 8; i++) {\n const c: Vec3 = [(i & 1) - 0.5, ((i >> 1) & 1) - 0.5, ((i >> 2) & 1) - 0.5];\n near += gridAt(cascade, uvwOf([world[0] + c[0] * voxel[0], world[1] + c[1] * voxel[1], world[2] + c[2] * voxel[2]]))[0];\n }\n const outside = vdbFrameShadowTotal(1, octaves);\n if (!(near > 0)) return [Math.max(unshadowed[0], 0) * outside, Math.max(unshadowed[1], 0) * outside, Math.max(unshadowed[2], 0) * outside, 1];\n const marchDepths = (dir: Vec3): Vec3 => {\n const step = 1 / Math.max(Math.abs(dir[0]) / voxel[0], Math.abs(dir[1]) / voxel[1], Math.abs(dir[2]) / voxel[2]);\n const probe: Vec3 = [world[0] + dir[0] * step * 0.5, world[1] + dir[1] * step * 0.5, world[2] + dir[2] * step * 0.5];\n const depths: Vec3 = [0, 0, 0];\n for (let i = 0; i < 1024; i++) {\n const uvw = uvwOf(probe);\n if (uvw.some((v) => v < 0 || v > 1) || vdbFrameShadowMarchDepth(depths, multipleScattering, octaves) > 6) break;\n const s = gridAt(cascade, uvw);\n const d = vdbFrameShadowStep(s[0], s[1], multipleScattering);\n for (let c = 0; c < 3; c++) {\n depths[c] = depths[c]! + d[c]! * step;\n probe[c] = probe[c]! + dir[c]! * step;\n }\n }\n return depths;\n };\n const irradiance: Vec3 = [0, 0, 0];\n for (const l of lights) {\n const depths = marchDepths(l.direction);\n const total =\n multipleScattering > 0\n ? vdbFrameIsotropicDiffusion(depths[2], marchDepths([-l.direction[0], -l.direction[1], -l.direction[2]])[2], depths[1])\n : vdbFrameShadowTotal(vdbFrameShadowTransmittance(depths, multipleScattering, octaves)[1], octaves);\n for (let c = 0; c < 3; c++) irradiance[c] = irradiance[c]! + l.color[c]! * total;\n }\n return [Math.max(irradiance[0], 0), Math.max(irradiance[1], 0), Math.max(irradiance[2], 0), 1];\n}\n"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/** Column-major 4x4. */
|
|
2
|
+
export type VDBMat4 = ArrayLike<number>;
|
|
3
|
+
type V3 = [number, number, number];
|
|
4
|
+
/** A plane `normal · p + constant = 0` (normalized). */
|
|
5
|
+
interface Plane {
|
|
6
|
+
n: V3;
|
|
7
|
+
c: number;
|
|
8
|
+
}
|
|
9
|
+
/** `a × b`, column-major 4x4. */
|
|
10
|
+
export declare function vdbMat4Multiply(a: VDBMat4, b: VDBMat4, out?: Float64Array): Float64Array;
|
|
11
|
+
/** The inverse of a column-major 4x4 (three's `Matrix4.invert`; the zero matrix when singular). */
|
|
12
|
+
export declare function vdbMat4Invert(m: VDBMat4, out?: Float64Array): Float64Array;
|
|
13
|
+
/** `m · (x, y, z, 1)` divided by its w (three's `Vector3.applyMatrix4`). */
|
|
14
|
+
export declare function vdbMat4Point(m: VDBMat4, p: readonly number[]): V3;
|
|
15
|
+
/** `m · (x, y, z, w)`. */
|
|
16
|
+
export declare function vdbMat4Vec4(m: VDBMat4, v: readonly number[]): [number, number, number, number];
|
|
17
|
+
/** The largest axis scale of a column-major 4x4 (three's `Matrix4.getMaxScaleOnAxis`). */
|
|
18
|
+
export declare function vdbMat4MaxScale(m: VDBMat4): number;
|
|
19
|
+
/** The frustum of a projection (or view-projection), three's `Frustum.setFromProjectionMatrix` (planes 0–5). */
|
|
20
|
+
export declare function vdbFrustumPlanes(m: VDBMat4, coordinateSystem?: "webgl" | "webgpu", reversedDepth?: boolean): Plane[];
|
|
21
|
+
/** The world box of the unit box [-0.5, 0.5]³ under `m` (three's `Box3.applyMatrix4`). */
|
|
22
|
+
export declare function vdbUnitBoxBounds(m: VDBMat4): {
|
|
23
|
+
min: V3;
|
|
24
|
+
max: V3;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The per-camera state of the volume clip (his `FrameVolumeCollector.collect` set-up): the world frustum
|
|
28
|
+
* (WebGL convention, as his `frustum.setFromProjectionMatrix(projectionScreenMatrix)`), the view frustum
|
|
29
|
+
* (the camera's coordinate system and depth direction) and its 8 corners.
|
|
30
|
+
*/
|
|
31
|
+
export interface VDBFrameClipCamera {
|
|
32
|
+
readonly world: Plane[];
|
|
33
|
+
readonly view: Plane[];
|
|
34
|
+
readonly corners: V3[];
|
|
35
|
+
readonly viewMatrix: VDBMat4;
|
|
36
|
+
readonly projection: VDBMat4;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @param view World → view (three's `camera.matrixWorldInverse`), column-major.
|
|
40
|
+
* @param projection The projection (three's `camera.projectionMatrix`), column-major.
|
|
41
|
+
* @param o The projection's coordinate system (default `'webgpu'`, NDC z in [0, 1]) and depth direction.
|
|
42
|
+
*/
|
|
43
|
+
export declare function vdbFrameClipCamera(view: VDBMat4, projection: VDBMat4, o?: {
|
|
44
|
+
coordinateSystem?: "webgl" | "webgpu";
|
|
45
|
+
reversedDepth?: boolean;
|
|
46
|
+
}): VDBFrameClipCamera;
|
|
47
|
+
/** One volume after the clip: its matrices and the view depth range of its part inside the view frustum. */
|
|
48
|
+
export interface VDBFrameClippedVolume {
|
|
49
|
+
readonly localToView: Float64Array;
|
|
50
|
+
readonly viewToLocal: Float64Array;
|
|
51
|
+
readonly worldToLocal: Float64Array;
|
|
52
|
+
readonly viewNear: number;
|
|
53
|
+
readonly viewFar: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* His `FrameVolumeCollector.addVolume` for one volume box (`matrixWorld`: the local unit box → world):
|
|
57
|
+
* world-frustum culling, then the view depth range of the part of the box inside the view frustum
|
|
58
|
+
* (faces clipped to the planes, plus the frustum corners inside the box). Null when no part is in view.
|
|
59
|
+
*/
|
|
60
|
+
export declare function vdbFrameClipVolume(cam: VDBFrameClipCamera, matrixWorld: VDBMat4): VDBFrameClippedVolume | null;
|
|
61
|
+
/** A froxel rectangle in cells: `[x0, y0, x1, y1)`, bottom-left origin. */
|
|
62
|
+
export type VDBFroxelRect = [number, number, number, number];
|
|
63
|
+
/**
|
|
64
|
+
* His `getFroxelRect`: the screen rectangle of the volume box in froxel cells, one cell of padding for
|
|
65
|
+
* the linear filter; the whole grid when a corner is behind the camera. Null when it covers no cell.
|
|
66
|
+
*/
|
|
67
|
+
export declare function vdbFrameFroxelRect(localToView: VDBMat4, projection: VDBMat4, width: number, height: number): VDBFroxelRect | null;
|
|
68
|
+
/** His froxel area: the rectangle and slices of all volumes, one cell and one slice larger on each side. */
|
|
69
|
+
export interface VDBFroxelArea {
|
|
70
|
+
rect: VDBFroxelRect;
|
|
71
|
+
first: number;
|
|
72
|
+
count: number;
|
|
73
|
+
}
|
|
74
|
+
/** The empty area (count 0). */
|
|
75
|
+
export declare const vdbFroxelAreaEmpty: () => VDBFroxelArea;
|
|
76
|
+
/**
|
|
77
|
+
* His `getFroxelArea` over volumes that each already have a rect (`vdbFrameFroxelRect`) and a slice range
|
|
78
|
+
* (`vdbFrameSliceRange`); volumes without a rect are skipped. Count 0 when none covers a cell.
|
|
79
|
+
*/
|
|
80
|
+
export declare function vdbFrameFroxelArea(volumes: readonly {
|
|
81
|
+
rect: VDBFroxelRect | null;
|
|
82
|
+
first: number;
|
|
83
|
+
count: number;
|
|
84
|
+
}[], width: number, height: number, depth: number): VDBFroxelArea;
|
|
85
|
+
/** The slices of a volume (his `getFroxelSliceRange`): `{ first, count }`. */
|
|
86
|
+
export declare function vdbFrameVolumeSlices(viewNear: number, viewFar: number, range: readonly [number, number], depth: number): {
|
|
87
|
+
first: number;
|
|
88
|
+
count: number;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The bounding box of two areas (rect union, slice union), for a dispatch that must also clear what the
|
|
92
|
+
* last dispatch wrote. An empty area does not widen it.
|
|
93
|
+
*/
|
|
94
|
+
export declare function vdbFroxelAreaUnion(a: VDBFroxelArea, b: VDBFroxelArea): VDBFroxelArea;
|
|
95
|
+
/** His `getAtlasLayout`: tiles of tileWidth × tileHeight in an atlas that is about square. */
|
|
96
|
+
export declare function vdbFrameAtlasLayout(tileWidth: number, tileHeight: number, tileCount: number): {
|
|
97
|
+
columns: number;
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
};
|
|
101
|
+
/** Held sizes of {@link vdbFrameFroxelSize} (his frameLayout.js state). */
|
|
102
|
+
export interface VDBFroxelHeldSize {
|
|
103
|
+
canvasX: number;
|
|
104
|
+
canvasY: number;
|
|
105
|
+
bufferX: number;
|
|
106
|
+
bufferY: number;
|
|
107
|
+
}
|
|
108
|
+
/** A fresh held size (nothing held). */
|
|
109
|
+
export declare const vdbFroxelHeldSize: () => VDBFroxelHeldSize;
|
|
110
|
+
/**
|
|
111
|
+
* His `getFroxelSize`: the settings' width and height, at most the drawing-buffer pixels and, with
|
|
112
|
+
* `pixelsPerFroxel` N > 0, at most one froxel per N × N canvas pixels; `state` holds sizes through
|
|
113
|
+
* small changes.
|
|
114
|
+
*/
|
|
115
|
+
export declare function vdbFrameFroxelSize(settings: {
|
|
116
|
+
width: number;
|
|
117
|
+
height: number;
|
|
118
|
+
pixelsPerFroxel: number;
|
|
119
|
+
}, viewport: {
|
|
120
|
+
drawingBuffer: readonly [number, number];
|
|
121
|
+
canvas: readonly [number, number];
|
|
122
|
+
}, state?: VDBFroxelHeldSize | null): {
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* The clip rectangle of a froxel cell rectangle (his `getClipRect`), `padding` cells larger on each side:
|
|
128
|
+
* (x0, y0, x1, y1) in clip space; all 0 for an empty rectangle.
|
|
129
|
+
*/
|
|
130
|
+
export declare function vdbFrameClipRect(rect: VDBFroxelRect, width: number, height: number, padding: number): [number, number, number, number];
|
|
131
|
+
export {};
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):
|
|
2
|
+
// src/three-openvdb/frame/core/frameView.js (frustum clip of the volume boxes, clipped view depths,
|
|
3
|
+
// getFroxelSlice, getFroxelSliceRange, getFroxelRect, getFroxelArea) and
|
|
4
|
+
// src/three-openvdb/frame/core/frameLayout.js (getAtlasLayout, getFroxelSize);
|
|
5
|
+
// three.js r187 Frustum.setFromProjectionMatrix / intersectsBox, Box3.applyMatrix4 (MIT).
|
|
6
|
+
// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).
|
|
7
|
+
// Changes: plain arrays instead of three's math classes (engine-free, K6.1); `getFroxelSize` takes the
|
|
8
|
+
// drawing-buffer and canvas sizes instead of a renderer; a union of two froxel areas (the core's dispatch
|
|
9
|
+
// box). Divergences: DIVERGES.md (K3.1 rows; K6.1 rows).
|
|
10
|
+
/**
|
|
11
|
+
* Engine-free froxel view maths (K6.1; design §2.4, §3.2). The same numbers as
|
|
12
|
+
* `@pmndrs/vdb/three` `frame/view.ts` and `frame/layout.ts` (a unit test runs both on random
|
|
13
|
+
* cameras and boxes), on column-major `ArrayLike<number>` matrices. The core frame renderer imports
|
|
14
|
+
* these; they are also the twins of its CPU work.
|
|
15
|
+
*/
|
|
16
|
+
import { vdbFrameSliceRange } from "./index.js";
|
|
17
|
+
/** `a × b`, column-major 4x4. */
|
|
18
|
+
export function vdbMat4Multiply(a, b, out = new Float64Array(16)) {
|
|
19
|
+
const r = new Float64Array(16);
|
|
20
|
+
for (let c = 0; c < 4; c++) {
|
|
21
|
+
for (let row = 0; row < 4; row++) {
|
|
22
|
+
r[c * 4 + row] = a[row] * b[c * 4] + a[4 + row] * b[c * 4 + 1] + a[8 + row] * b[c * 4 + 2] + a[12 + row] * b[c * 4 + 3];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
out.set(r);
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
/** The inverse of a column-major 4x4 (three's `Matrix4.invert`; the zero matrix when singular). */
|
|
29
|
+
export function vdbMat4Invert(m, out = new Float64Array(16)) {
|
|
30
|
+
const [n11, n21, n31, n41, n12, n22, n32, n42, n13, n23, n33, n43, n14, n24, n34, n44] = Array.from(m);
|
|
31
|
+
const t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44;
|
|
32
|
+
const t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44;
|
|
33
|
+
const t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44;
|
|
34
|
+
const t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;
|
|
35
|
+
const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;
|
|
36
|
+
if (det === 0) {
|
|
37
|
+
out.fill(0);
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
const d = 1 / det;
|
|
41
|
+
const r = [
|
|
42
|
+
t11 * d,
|
|
43
|
+
(n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * d,
|
|
44
|
+
(n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * d,
|
|
45
|
+
(n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * d,
|
|
46
|
+
t12 * d,
|
|
47
|
+
(n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * d,
|
|
48
|
+
(n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * d,
|
|
49
|
+
(n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * d,
|
|
50
|
+
t13 * d,
|
|
51
|
+
(n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * d,
|
|
52
|
+
(n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * d,
|
|
53
|
+
(n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * d,
|
|
54
|
+
t14 * d,
|
|
55
|
+
(n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * d,
|
|
56
|
+
(n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * d,
|
|
57
|
+
(n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * d,
|
|
58
|
+
];
|
|
59
|
+
out.set(r);
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
/** `m · (x, y, z, 1)` divided by its w (three's `Vector3.applyMatrix4`). */
|
|
63
|
+
export function vdbMat4Point(m, p) {
|
|
64
|
+
const [x, y, z] = p;
|
|
65
|
+
const w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]);
|
|
66
|
+
return [(m[0] * x + m[4] * y + m[8] * z + m[12]) * w, (m[1] * x + m[5] * y + m[9] * z + m[13]) * w, (m[2] * x + m[6] * y + m[10] * z + m[14]) * w];
|
|
67
|
+
}
|
|
68
|
+
/** `m · (x, y, z, w)`. */
|
|
69
|
+
export function vdbMat4Vec4(m, v) {
|
|
70
|
+
const o = [0, 0, 0, 0];
|
|
71
|
+
for (let r = 0; r < 4; r++)
|
|
72
|
+
o[r] = m[r] * v[0] + m[4 + r] * v[1] + m[8 + r] * v[2] + m[12 + r] * v[3];
|
|
73
|
+
return o;
|
|
74
|
+
}
|
|
75
|
+
/** The largest axis scale of a column-major 4x4 (three's `Matrix4.getMaxScaleOnAxis`). */
|
|
76
|
+
export function vdbMat4MaxScale(m) {
|
|
77
|
+
const sx = m[0] * m[0] + m[1] * m[1] + m[2] * m[2];
|
|
78
|
+
const sy = m[4] * m[4] + m[5] * m[5] + m[6] * m[6];
|
|
79
|
+
const sz = m[8] * m[8] + m[9] * m[9] + m[10] * m[10];
|
|
80
|
+
return Math.sqrt(Math.max(sx, sy, sz));
|
|
81
|
+
}
|
|
82
|
+
const plane = (x, y, z, w) => {
|
|
83
|
+
const inv = 1 / Math.hypot(x, y, z);
|
|
84
|
+
return { n: [x * inv, y * inv, z * inv], c: w * inv };
|
|
85
|
+
};
|
|
86
|
+
const distance = (p, v) => p.n[0] * v[0] + p.n[1] * v[1] + p.n[2] * v[2] + p.c;
|
|
87
|
+
/** The frustum of a projection (or view-projection), three's `Frustum.setFromProjectionMatrix` (planes 0–5). */
|
|
88
|
+
export function vdbFrustumPlanes(m, coordinateSystem = "webgl", reversedDepth = false) {
|
|
89
|
+
const e = m;
|
|
90
|
+
const planes = [
|
|
91
|
+
plane(e[3] - e[0], e[7] - e[4], e[11] - e[8], e[15] - e[12]),
|
|
92
|
+
plane(e[3] + e[0], e[7] + e[4], e[11] + e[8], e[15] + e[12]),
|
|
93
|
+
plane(e[3] + e[1], e[7] + e[5], e[11] + e[9], e[15] + e[13]),
|
|
94
|
+
plane(e[3] - e[1], e[7] - e[5], e[11] - e[9], e[15] - e[13]),
|
|
95
|
+
];
|
|
96
|
+
if (reversedDepth) {
|
|
97
|
+
planes.push(plane(e[2], e[6], e[10], e[14]), plane(e[3] - e[2], e[7] - e[6], e[11] - e[10], e[15] - e[14]));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
planes.push(plane(e[3] - e[2], e[7] - e[6], e[11] - e[10], e[15] - e[14]));
|
|
101
|
+
planes.push(coordinateSystem === "webgl" ? plane(e[3] + e[2], e[7] + e[6], e[11] + e[10], e[15] + e[14]) : plane(e[2], e[6], e[10], e[14]));
|
|
102
|
+
}
|
|
103
|
+
return planes;
|
|
104
|
+
}
|
|
105
|
+
/** three's `Frustum.intersectsBox`. */
|
|
106
|
+
function intersectsBox(planes, min, max) {
|
|
107
|
+
for (const p of planes) {
|
|
108
|
+
const v = [p.n[0] > 0 ? max[0] : min[0], p.n[1] > 0 ? max[1] : min[1], p.n[2] > 0 ? max[2] : min[2]];
|
|
109
|
+
if (distance(p, v) < 0)
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
/** The world box of the unit box [-0.5, 0.5]³ under `m` (three's `Box3.applyMatrix4`). */
|
|
115
|
+
export function vdbUnitBoxBounds(m) {
|
|
116
|
+
const min = [Infinity, Infinity, Infinity];
|
|
117
|
+
const max = [-Infinity, -Infinity, -Infinity];
|
|
118
|
+
for (let i = 0; i < 8; i++) {
|
|
119
|
+
const p = vdbMat4Point(m, [i & 1 ? 0.5 : -0.5, i & 2 ? 0.5 : -0.5, i & 4 ? 0.5 : -0.5]);
|
|
120
|
+
for (let a = 0; a < 3; a++) {
|
|
121
|
+
min[a] = Math.min(min[a], p[a]);
|
|
122
|
+
max[a] = Math.max(max[a], p[a]);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return { min, max };
|
|
126
|
+
}
|
|
127
|
+
// NOTE Point where three planes meet (normal . p + constant = 0 for each)
|
|
128
|
+
function intersectPlanes(a, b, c) {
|
|
129
|
+
const cross = (u, v) => [u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]];
|
|
130
|
+
const ca = cross(b.n, c.n);
|
|
131
|
+
const cb = cross(c.n, a.n);
|
|
132
|
+
const cc = cross(a.n, b.n);
|
|
133
|
+
const d = a.n[0] * ca[0] + a.n[1] * ca[1] + a.n[2] * ca[2];
|
|
134
|
+
return [0, 1, 2].map((i) => (ca[i] * -a.c + cb[i] * -b.c + cc[i] * -c.c) / d);
|
|
135
|
+
}
|
|
136
|
+
// NOTE Corners of each face of the unit box, in order around the face (corner bits: 1 x, 2 y, 4 z)
|
|
137
|
+
const BOX_FACES = [
|
|
138
|
+
[0, 2, 6, 4],
|
|
139
|
+
[1, 3, 7, 5],
|
|
140
|
+
[0, 1, 5, 4],
|
|
141
|
+
[2, 3, 7, 6],
|
|
142
|
+
[0, 1, 3, 2],
|
|
143
|
+
[4, 5, 7, 6],
|
|
144
|
+
];
|
|
145
|
+
const inUnitBox = (p) => p[0] >= -0.5 && p[0] <= 0.5 && p[1] >= -0.5 && p[1] <= 0.5 && p[2] >= -0.5 && p[2] <= 0.5;
|
|
146
|
+
/**
|
|
147
|
+
* @param view World → view (three's `camera.matrixWorldInverse`), column-major.
|
|
148
|
+
* @param projection The projection (three's `camera.projectionMatrix`), column-major.
|
|
149
|
+
* @param o The projection's coordinate system (default `'webgpu'`, NDC z in [0, 1]) and depth direction.
|
|
150
|
+
*/
|
|
151
|
+
export function vdbFrameClipCamera(view, projection, o = {}) {
|
|
152
|
+
const world = vdbFrustumPlanes(vdbMat4Multiply(projection, view), "webgl", false);
|
|
153
|
+
const viewPlanes = vdbFrustumPlanes(projection, o.coordinateSystem ?? "webgpu", o.reversedDepth ?? false);
|
|
154
|
+
const corners = [];
|
|
155
|
+
for (let i = 0; i < 8; i++)
|
|
156
|
+
corners.push(intersectPlanes(viewPlanes[i & 1], viewPlanes[2 + ((i >> 1) & 1)], viewPlanes[4 + ((i >> 2) & 1)]));
|
|
157
|
+
return { world, view: viewPlanes, corners, viewMatrix: view, projection };
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* His `FrameVolumeCollector.addVolume` for one volume box (`matrixWorld`: the local unit box → world):
|
|
161
|
+
* world-frustum culling, then the view depth range of the part of the box inside the view frustum
|
|
162
|
+
* (faces clipped to the planes, plus the frustum corners inside the box). Null when no part is in view.
|
|
163
|
+
*/
|
|
164
|
+
export function vdbFrameClipVolume(cam, matrixWorld) {
|
|
165
|
+
const worldToLocal = vdbMat4Invert(matrixWorld);
|
|
166
|
+
const box = vdbUnitBoxBounds(matrixWorld);
|
|
167
|
+
if (!intersectsBox(cam.world, box.min, box.max))
|
|
168
|
+
return null;
|
|
169
|
+
const localToView = vdbMat4Multiply(cam.viewMatrix, matrixWorld);
|
|
170
|
+
const viewToLocal = vdbMat4Invert(localToView);
|
|
171
|
+
const boxCorners = [];
|
|
172
|
+
for (let i = 0; i < 8; i++)
|
|
173
|
+
boxCorners.push(vdbMat4Point(localToView, [i & 1 ? 0.5 : -0.5, i & 2 ? 0.5 : -0.5, i & 4 ? 0.5 : -0.5]));
|
|
174
|
+
let near = Infinity;
|
|
175
|
+
let far = -Infinity;
|
|
176
|
+
for (const corner of cam.corners) {
|
|
177
|
+
if (inUnitBox(vdbMat4Point(viewToLocal, corner))) {
|
|
178
|
+
near = Math.min(near, -corner[2]);
|
|
179
|
+
far = Math.max(far, -corner[2]);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
for (const face of BOX_FACES) {
|
|
183
|
+
let input = face.map((i) => boxCorners[i]);
|
|
184
|
+
for (let p = 0; p < 6 && input.length > 0; p++) {
|
|
185
|
+
const pl = cam.view[p];
|
|
186
|
+
const output = [];
|
|
187
|
+
for (let i = 0; i < input.length; i++) {
|
|
188
|
+
const a = input[i];
|
|
189
|
+
const b = input[(i + 1) % input.length];
|
|
190
|
+
const da = distance(pl, a);
|
|
191
|
+
const db = distance(pl, b);
|
|
192
|
+
if (da >= 0)
|
|
193
|
+
output.push([...a]);
|
|
194
|
+
if (da >= 0 !== db >= 0) {
|
|
195
|
+
const t = da / (da - db);
|
|
196
|
+
output.push([a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t]);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
input = output;
|
|
200
|
+
}
|
|
201
|
+
for (const v of input) {
|
|
202
|
+
near = Math.min(near, -v[2]);
|
|
203
|
+
far = Math.max(far, -v[2]);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (!(near <= far))
|
|
207
|
+
return null;
|
|
208
|
+
return { localToView, viewToLocal, worldToLocal, viewNear: near, viewFar: far };
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* His `getFroxelRect`: the screen rectangle of the volume box in froxel cells, one cell of padding for
|
|
212
|
+
* the linear filter; the whole grid when a corner is behind the camera. Null when it covers no cell.
|
|
213
|
+
*/
|
|
214
|
+
export function vdbFrameFroxelRect(localToView, projection, width, height) {
|
|
215
|
+
const clip = vdbMat4Multiply(projection, localToView);
|
|
216
|
+
let minX = Infinity;
|
|
217
|
+
let minY = Infinity;
|
|
218
|
+
let maxX = -Infinity;
|
|
219
|
+
let maxY = -Infinity;
|
|
220
|
+
for (let i = 0; i < 8; i++) {
|
|
221
|
+
const c = vdbMat4Vec4(clip, [i & 1 ? 0.5 : -0.5, i & 2 ? 0.5 : -0.5, i & 4 ? 0.5 : -0.5, 1]);
|
|
222
|
+
if (c[3] <= 1e-6)
|
|
223
|
+
return [0, 0, width, height];
|
|
224
|
+
minX = Math.min(minX, c[0] / c[3]);
|
|
225
|
+
minY = Math.min(minY, c[1] / c[3]);
|
|
226
|
+
maxX = Math.max(maxX, c[0] / c[3]);
|
|
227
|
+
maxY = Math.max(maxY, c[1] / c[3]);
|
|
228
|
+
}
|
|
229
|
+
const x0 = Math.max(0, Math.floor((minX * 0.5 + 0.5) * width) - 1);
|
|
230
|
+
const y0 = Math.max(0, Math.floor((minY * 0.5 + 0.5) * height) - 1);
|
|
231
|
+
const x1 = Math.min(width, Math.ceil((maxX * 0.5 + 0.5) * width) + 1);
|
|
232
|
+
const y1 = Math.min(height, Math.ceil((maxY * 0.5 + 0.5) * height) + 1);
|
|
233
|
+
if (x1 <= x0 || y1 <= y0)
|
|
234
|
+
return null;
|
|
235
|
+
return [x0, y0, x1, y1];
|
|
236
|
+
}
|
|
237
|
+
/** The empty area (count 0). */
|
|
238
|
+
export const vdbFroxelAreaEmpty = () => ({ rect: [0, 0, 0, 0], first: 0, count: 0 });
|
|
239
|
+
/**
|
|
240
|
+
* His `getFroxelArea` over volumes that each already have a rect (`vdbFrameFroxelRect`) and a slice range
|
|
241
|
+
* (`vdbFrameSliceRange`); volumes without a rect are skipped. Count 0 when none covers a cell.
|
|
242
|
+
*/
|
|
243
|
+
export function vdbFrameFroxelArea(volumes, width, height, depth) {
|
|
244
|
+
let x0 = Infinity;
|
|
245
|
+
let y0 = Infinity;
|
|
246
|
+
let x1 = -Infinity;
|
|
247
|
+
let y1 = -Infinity;
|
|
248
|
+
let first = Infinity;
|
|
249
|
+
let last = -Infinity;
|
|
250
|
+
for (const v of volumes) {
|
|
251
|
+
if (!v.rect)
|
|
252
|
+
continue;
|
|
253
|
+
x0 = Math.min(x0, v.rect[0]);
|
|
254
|
+
y0 = Math.min(y0, v.rect[1]);
|
|
255
|
+
x1 = Math.max(x1, v.rect[2]);
|
|
256
|
+
y1 = Math.max(y1, v.rect[3]);
|
|
257
|
+
first = Math.min(first, v.first);
|
|
258
|
+
last = Math.max(last, v.first + v.count - 1);
|
|
259
|
+
}
|
|
260
|
+
if (first > last)
|
|
261
|
+
return vdbFroxelAreaEmpty();
|
|
262
|
+
const f = Math.max(0, first - 1);
|
|
263
|
+
return { rect: [Math.max(0, x0 - 1), Math.max(0, y0 - 1), Math.min(width, x1 + 1), Math.min(height, y1 + 1)], first: f, count: Math.min(depth - 1, last + 1) - f + 1 };
|
|
264
|
+
}
|
|
265
|
+
/** The slices of a volume (his `getFroxelSliceRange`): `{ first, count }`. */
|
|
266
|
+
export function vdbFrameVolumeSlices(viewNear, viewFar, range, depth) {
|
|
267
|
+
return vdbFrameSliceRange(viewNear, viewFar, [range[0], range[1]], depth);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The bounding box of two areas (rect union, slice union), for a dispatch that must also clear what the
|
|
271
|
+
* last dispatch wrote. An empty area does not widen it.
|
|
272
|
+
*/
|
|
273
|
+
export function vdbFroxelAreaUnion(a, b) {
|
|
274
|
+
if (b.count <= 0 || b.rect[2] <= b.rect[0] || b.rect[3] <= b.rect[1])
|
|
275
|
+
return { rect: [...a.rect], first: a.first, count: a.count };
|
|
276
|
+
if (a.count <= 0 || a.rect[2] <= a.rect[0] || a.rect[3] <= a.rect[1])
|
|
277
|
+
return { rect: [...b.rect], first: b.first, count: b.count };
|
|
278
|
+
const first = Math.min(a.first, b.first);
|
|
279
|
+
const end = Math.max(a.first + a.count, b.first + b.count);
|
|
280
|
+
return {
|
|
281
|
+
rect: [Math.min(a.rect[0], b.rect[0]), Math.min(a.rect[1], b.rect[1]), Math.max(a.rect[2], b.rect[2]), Math.max(a.rect[3], b.rect[3])],
|
|
282
|
+
first,
|
|
283
|
+
count: end - first,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
/** His `getAtlasLayout`: tiles of tileWidth × tileHeight in an atlas that is about square. */
|
|
287
|
+
export function vdbFrameAtlasLayout(tileWidth, tileHeight, tileCount) {
|
|
288
|
+
const columns = Math.ceil(Math.sqrt((tileCount * tileHeight) / tileWidth));
|
|
289
|
+
const rows = Math.ceil(tileCount / columns);
|
|
290
|
+
return { columns, width: tileWidth * columns, height: tileHeight * rows };
|
|
291
|
+
}
|
|
292
|
+
/** A fresh held size (nothing held). */
|
|
293
|
+
export const vdbFroxelHeldSize = () => ({ canvasX: 0, canvasY: 0, bufferX: 0, bufferY: 0 });
|
|
294
|
+
// NOTE A size that changes by less than this share is kept (mobile address bars).
|
|
295
|
+
const STEADY_CHANGE = 0.15;
|
|
296
|
+
const steady = (size, held) => (held > 0 && Math.abs(size - held) <= held * STEADY_CHANGE ? held : size);
|
|
297
|
+
/**
|
|
298
|
+
* His `getFroxelSize`: the settings' width and height, at most the drawing-buffer pixels and, with
|
|
299
|
+
* `pixelsPerFroxel` N > 0, at most one froxel per N × N canvas pixels; `state` holds sizes through
|
|
300
|
+
* small changes.
|
|
301
|
+
*/
|
|
302
|
+
export function vdbFrameFroxelSize(settings, viewport, state = null) {
|
|
303
|
+
let [bx, by] = viewport.drawingBuffer;
|
|
304
|
+
let capX = bx;
|
|
305
|
+
let capY = by;
|
|
306
|
+
if (settings.pixelsPerFroxel > 0) {
|
|
307
|
+
let [cx, cy] = viewport.canvas;
|
|
308
|
+
if (state) {
|
|
309
|
+
state.canvasX = steady(cx, state.canvasX);
|
|
310
|
+
state.canvasY = steady(cy, state.canvasY);
|
|
311
|
+
state.bufferX = steady(bx, state.bufferX);
|
|
312
|
+
state.bufferY = steady(by, state.bufferY);
|
|
313
|
+
[cx, cy, bx, by] = [state.canvasX, state.canvasY, state.bufferX, state.bufferY];
|
|
314
|
+
}
|
|
315
|
+
capX = Math.min(bx, Math.ceil(cx / settings.pixelsPerFroxel));
|
|
316
|
+
capY = Math.min(by, Math.ceil(cy / settings.pixelsPerFroxel));
|
|
317
|
+
}
|
|
318
|
+
else if (state) {
|
|
319
|
+
state.canvasX = state.canvasY = state.bufferX = state.bufferY = 0;
|
|
320
|
+
}
|
|
321
|
+
return { width: Math.max(1, Math.min(Math.round(settings.width), capX)), height: Math.max(1, Math.min(Math.round(settings.height), capY)) };
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The clip rectangle of a froxel cell rectangle (his `getClipRect`), `padding` cells larger on each side:
|
|
325
|
+
* (x0, y0, x1, y1) in clip space; all 0 for an empty rectangle.
|
|
326
|
+
*/
|
|
327
|
+
export function vdbFrameClipRect(rect, width, height, padding) {
|
|
328
|
+
if (rect[2] <= rect[0] || rect[3] <= rect[1])
|
|
329
|
+
return [0, 0, 0, 0];
|
|
330
|
+
return [
|
|
331
|
+
(Math.max(0, rect[0] - padding) / width) * 2 - 1,
|
|
332
|
+
(Math.max(0, rect[1] - padding) / height) * 2 - 1,
|
|
333
|
+
(Math.min(width, rect[2] + padding) / width) * 2 - 1,
|
|
334
|
+
(Math.min(height, rect[3] + padding) / height) * 2 - 1,
|
|
335
|
+
];
|
|
336
|
+
}
|
|
337
|
+
//# sourceMappingURL=view.js.map
|