@pmndrs/vdb 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +592 -2
- package/README.md +85 -37
- package/THIRD_PARTY_NOTICES.md +197 -29
- package/dist/core/compute/atlas.d.ts +10 -2
- package/dist/core/compute/atlas.js +6 -1
- package/dist/core/compute/atlas.js.map +1 -1
- package/dist/core/compute/index.d.ts +3 -3
- package/dist/core/compute/index.js +2 -2
- package/dist/core/compute/index.js.map +1 -1
- package/dist/core/compute/majorant-build.d.ts +45 -0
- package/dist/core/compute/majorant-build.js +193 -0
- package/dist/core/compute/majorant-build.js.map +1 -0
- package/dist/core/compute/multi-scale.d.ts +155 -0
- package/dist/core/compute/multi-scale.js +684 -0
- package/dist/core/compute/multi-scale.js.map +1 -0
- package/dist/core/compute/pyramid.d.ts +22 -7
- package/dist/core/compute/pyramid.js +22 -9
- package/dist/core/compute/pyramid.js.map +1 -1
- package/dist/core/compute/shared.d.ts +1 -0
- package/dist/core/compute/shared.js.map +1 -1
- package/dist/core/compute/stats.d.ts +10 -3
- package/dist/core/compute/stats.js +6 -1
- package/dist/core/compute/stats.js.map +1 -1
- package/dist/core/compute/value-transform.d.ts +8 -1
- package/dist/core/compute/value-transform.js +9 -3
- package/dist/core/compute/value-transform.js.map +1 -1
- package/dist/core/errors.d.ts +10 -0
- package/dist/core/errors.js +8 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/frame/emission.d.ts +85 -0
- package/dist/core/frame/emission.js +422 -0
- package/dist/core/frame/emission.js.map +1 -0
- package/dist/core/frame/environment.d.ts +47 -0
- package/dist/core/frame/environment.js +178 -0
- package/dist/core/frame/environment.js.map +1 -0
- package/dist/core/frame/index.d.ts +39 -0
- package/dist/core/frame/index.js +27 -0
- package/dist/core/frame/index.js.map +1 -0
- package/dist/core/frame/kernels.d.ts +115 -0
- package/dist/core/frame/kernels.js +496 -0
- package/dist/core/frame/kernels.js.map +1 -0
- package/dist/core/frame/limits.d.ts +67 -0
- package/dist/core/frame/limits.js +109 -0
- package/dist/core/frame/limits.js.map +1 -0
- package/dist/core/frame/phase.d.ts +17 -0
- package/dist/core/frame/phase.js +53 -0
- package/dist/core/frame/phase.js.map +1 -0
- package/dist/core/frame/pipelines.d.ts +49 -0
- package/dist/core/frame/pipelines.js +147 -0
- package/dist/core/frame/pipelines.js.map +1 -0
- package/dist/core/frame/renderer.d.ts +122 -0
- package/dist/core/frame/renderer.js +1712 -0
- package/dist/core/frame/renderer.js.map +1 -0
- package/dist/core/frame/resources.d.ts +71 -0
- package/dist/core/frame/resources.js +100 -0
- package/dist/core/frame/resources.js.map +1 -0
- package/dist/core/frame/scattering.d.ts +97 -0
- package/dist/core/frame/scattering.js +332 -0
- package/dist/core/frame/scattering.js.map +1 -0
- package/dist/core/frame/settings.d.ts +243 -0
- package/dist/core/frame/settings.js +67 -0
- package/dist/core/frame/settings.js.map +1 -0
- package/dist/core/frame/shadows.d.ts +55 -0
- package/dist/core/frame/shadows.js +460 -0
- package/dist/core/frame/shadows.js.map +1 -0
- package/dist/core/frame/types.d.ts +415 -0
- package/dist/core/frame/types.js +49 -0
- package/dist/core/frame/types.js.map +1 -0
- package/dist/core/frame/uniforms.d.ts +105 -0
- package/dist/core/frame/uniforms.js +276 -0
- package/dist/core/frame/uniforms.js.map +1 -0
- package/dist/core/frame/wgsl/chunks.d.ts +4 -0
- package/dist/core/frame/wgsl/chunks.js +728 -0
- package/dist/core/frame/wgsl/chunks.js.map +1 -0
- package/dist/core/frame/wgsl/emission.d.ts +82 -0
- package/dist/core/frame/wgsl/emission.js +353 -0
- package/dist/core/frame/wgsl/emission.js.map +1 -0
- package/dist/core/frame/wgsl/environment.d.ts +42 -0
- package/dist/core/frame/wgsl/environment.js +711 -0
- package/dist/core/frame/wgsl/environment.js.map +1 -0
- package/dist/core/frame/wgsl/gather.d.ts +55 -0
- package/dist/core/frame/wgsl/gather.js +850 -0
- package/dist/core/frame/wgsl/gather.js.map +1 -0
- package/dist/core/frame/wgsl/integrate.d.ts +78 -0
- package/dist/core/frame/wgsl/integrate.js +213 -0
- package/dist/core/frame/wgsl/integrate.js.map +1 -0
- package/dist/core/frame/wgsl/lighting.d.ts +103 -0
- package/dist/core/frame/wgsl/lighting.js +1636 -0
- package/dist/core/frame/wgsl/lighting.js.map +1 -0
- package/dist/core/frame/wgsl/occluders.d.ts +20 -0
- package/dist/core/frame/wgsl/occluders.js +95 -0
- package/dist/core/frame/wgsl/occluders.js.map +1 -0
- package/dist/core/frame/wgsl/resolve.d.ts +19 -0
- package/dist/core/frame/wgsl/resolve.js +205 -0
- package/dist/core/frame/wgsl/resolve.js.map +1 -0
- package/dist/core/frame/wgsl/shadows.d.ts +35 -0
- package/dist/core/frame/wgsl/shadows.js +328 -0
- package/dist/core/frame/wgsl/shadows.js.map +1 -0
- package/dist/core/half.d.ts +11 -0
- package/dist/core/half.js +22 -0
- package/dist/core/half.js.map +1 -0
- package/dist/core/index.d.ts +25 -3
- package/dist/core/index.js +23 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/internal.d.ts +17 -1
- package/dist/core/internal.js +18 -1
- package/dist/core/internal.js.map +1 -1
- package/dist/core/pool/image-header.d.ts +13 -2
- package/dist/core/pool/image-header.js +24 -5
- package/dist/core/pool/image-header.js.map +1 -1
- package/dist/core/pool/layout.d.ts +35 -1
- package/dist/core/pool/layout.js +51 -2
- package/dist/core/pool/layout.js.map +1 -1
- package/dist/core/pool/limits.d.ts +1 -0
- package/dist/core/pool/limits.js +1 -0
- package/dist/core/pool/limits.js.map +1 -1
- package/dist/core/pool/pool.d.ts +120 -15
- package/dist/core/pool/pool.js +255 -24
- package/dist/core/pool/pool.js.map +1 -1
- package/dist/core/reference/index.d.ts +6 -0
- package/dist/core/reference/index.js +7 -0
- package/dist/core/reference/index.js.map +1 -0
- package/dist/core/reference/renderer.d.ts +105 -0
- package/dist/core/reference/renderer.js +474 -0
- package/dist/core/reference/renderer.js.map +1 -0
- package/dist/core/reference/wgsl.d.ts +65 -0
- package/dist/core/reference/wgsl.js +803 -0
- package/dist/core/reference/wgsl.js.map +1 -0
- package/dist/{three → core}/sequence.d.ts +32 -2
- package/dist/{three → core}/sequence.js +24 -2
- package/dist/core/sequence.js.map +1 -0
- package/dist/core/source/brick-cache.d.ts +165 -0
- package/dist/core/source/brick-cache.js +627 -0
- package/dist/core/source/brick-cache.js.map +1 -0
- package/dist/core/source/dense-fill.d.ts +53 -0
- package/dist/core/source/dense-fill.js +377 -0
- package/dist/core/source/dense-fill.js.map +1 -0
- package/dist/core/source/dense.d.ts +33 -2
- package/dist/core/source/dense.js +121 -24
- package/dist/core/source/dense.js.map +1 -1
- package/dist/core/source/sparse-wgsl.d.ts +92 -0
- package/dist/core/source/sparse-wgsl.js +481 -0
- package/dist/core/source/sparse-wgsl.js.map +1 -0
- package/dist/core/source/sparse.d.ts +192 -0
- package/dist/core/source/sparse.js +762 -0
- package/dist/core/source/sparse.js.map +1 -0
- package/dist/core/source/types.d.ts +59 -2
- package/dist/core/source/types.js.map +1 -1
- package/dist/core/surface/index.d.ts +10 -0
- package/dist/core/surface/index.js +9 -0
- package/dist/core/surface/index.js.map +1 -0
- package/dist/core/surface/level-set-pass.d.ts +140 -0
- package/dist/core/surface/level-set-pass.js +291 -0
- package/dist/core/surface/level-set-pass.js.map +1 -0
- package/dist/core/surface/level-set-wgsl.d.ts +46 -0
- package/dist/core/surface/level-set-wgsl.js +99 -0
- package/dist/core/surface/level-set-wgsl.js.map +1 -0
- package/dist/core/surface/points.d.ts +109 -0
- package/dist/core/surface/points.js +226 -0
- package/dist/core/surface/points.js.map +1 -0
- package/dist/core/types.d.ts +12 -3
- package/dist/core/types.js +6 -2
- package/dist/core/types.js.map +1 -1
- package/dist/core/wgsl/api.d.ts +29 -5
- package/dist/core/wgsl/api.js +110 -27
- package/dist/core/wgsl/api.js.map +1 -1
- package/dist/core/wgsl/generate.d.ts +8 -0
- package/dist/core/wgsl/generate.js +195 -22
- package/dist/core/wgsl/generate.js.map +1 -1
- package/dist/core/wgsl/lean.d.ts +50 -0
- package/dist/core/wgsl/lean.js +327 -0
- package/dist/core/wgsl/lean.js.map +1 -0
- package/dist/core/wgsl/level-set.d.ts +5 -1
- package/dist/core/wgsl/level-set.js +11 -5
- package/dist/core/wgsl/level-set.js.map +1 -1
- package/dist/core/wgsl/majorant.d.ts +62 -0
- package/dist/core/wgsl/majorant.js +381 -0
- package/dist/core/wgsl/majorant.js.map +1 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +2 -2
- package/dist/core/wgsl/pnanovdb.chunks.generated.js +15 -12
- package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -1
- package/dist/core/wgsl/types.d.ts +97 -3
- package/dist/core/wgsl/types.js.map +1 -1
- package/dist/three/coarse-first.d.ts +53 -8
- package/dist/three/coarse-first.js +24 -6
- package/dist/three/coarse-first.js.map +1 -1
- package/dist/three/compute.d.ts +12 -2
- package/dist/three/compute.js +16 -6
- package/dist/three/compute.js.map +1 -1
- package/dist/three/device.d.ts +7 -0
- package/dist/three/device.js +3 -0
- package/dist/three/device.js.map +1 -1
- package/dist/three/frame/core-environment.d.ts +38 -0
- package/dist/three/frame/core-environment.js +154 -0
- package/dist/three/frame/core-environment.js.map +1 -0
- package/dist/three/frame/core-integrate-material.d.ts +34 -0
- package/dist/three/frame/core-integrate-material.js +162 -0
- package/dist/three/frame/core-integrate-material.js.map +1 -0
- package/dist/three/frame/core-occluders.d.ts +53 -0
- package/dist/three/frame/core-occluders.js +193 -0
- package/dist/three/frame/core-occluders.js.map +1 -0
- package/dist/three/frame/core-structs.d.ts +34 -0
- package/dist/three/frame/core-structs.js +61 -0
- package/dist/three/frame/core-structs.js.map +1 -0
- package/dist/three/frame/core-textures.d.ts +41 -0
- package/dist/three/frame/core-textures.js +114 -0
- package/dist/three/frame/core-textures.js.map +1 -0
- package/dist/three/frame/emission-light.d.ts +64 -114
- package/dist/three/frame/emission-light.js +188 -567
- package/dist/three/frame/emission-light.js.map +1 -1
- package/dist/three/frame/index.d.ts +11 -31
- package/dist/three/frame/index.js +9 -29
- package/dist/three/frame/index.js.map +1 -1
- package/dist/three/frame/medium.d.ts +12 -0
- package/dist/three/frame/medium.js.map +1 -1
- package/dist/three/frame/renderer.d.ts +58 -454
- package/dist/three/frame/renderer.js +409 -1427
- package/dist/three/frame/renderer.js.map +1 -1
- package/dist/three/frame/spectrum.d.ts +0 -14
- package/dist/three/frame/spectrum.js +2 -23
- package/dist/three/frame/spectrum.js.map +1 -1
- package/dist/three/frame/three-internals.d.ts +3 -8
- package/dist/three/frame/three-internals.js +13 -11
- package/dist/three/frame/three-internals.js.map +1 -1
- package/dist/three/frame/volume-shadows.d.ts +93 -107
- package/dist/three/frame/volume-shadows.js +278 -631
- package/dist/three/frame/volume-shadows.js.map +1 -1
- package/dist/three/frame/volume.d.ts +91 -33
- package/dist/three/frame/volume.js +63 -51
- package/dist/three/frame/volume.js.map +1 -1
- package/dist/three/grid-node.d.ts +34 -1
- package/dist/three/grid-node.js +36 -1
- package/dist/three/grid-node.js.map +1 -1
- package/dist/three/index.d.ts +20 -11
- package/dist/three/index.js +21 -12
- package/dist/three/index.js.map +1 -1
- package/dist/three/internal.d.ts +14 -8
- package/dist/three/internal.js +11 -7
- package/dist/three/internal.js.map +1 -1
- package/dist/three/level-set-material.d.ts +81 -8
- package/dist/three/level-set-material.js +162 -125
- package/dist/three/level-set-material.js.map +1 -1
- package/dist/three/level-set-physical-material.d.ts +154 -0
- package/dist/three/level-set-physical-material.js +253 -0
- package/dist/three/level-set-physical-material.js.map +1 -0
- package/dist/three/level-set-velocity.d.ts +94 -0
- package/dist/three/level-set-velocity.js +208 -0
- package/dist/three/level-set-velocity.js.map +1 -0
- package/dist/three/material.d.ts +141 -11
- package/dist/three/material.js +161 -18
- package/dist/three/material.js.map +1 -1
- package/dist/three/points.d.ts +60 -4
- package/dist/three/points.js +140 -9
- package/dist/three/points.js.map +1 -1
- package/dist/three/sparse-source.d.ts +49 -117
- package/dist/three/sparse-source.js +109 -580
- package/dist/three/sparse-source.js.map +1 -1
- package/dist/three/volume-source.d.ts +11 -156
- package/dist/three/volume-source.js +29 -272
- package/dist/three/volume-source.js.map +1 -1
- package/dist/tools/cpu/brick-atlas.d.ts +36 -0
- package/dist/tools/cpu/brick-atlas.js +129 -0
- package/dist/tools/cpu/brick-atlas.js.map +1 -0
- package/dist/tools/cpu/compute.d.ts +23 -4
- package/dist/tools/cpu/compute.js +35 -14
- package/dist/tools/cpu/compute.js.map +1 -1
- package/dist/tools/cpu/lean-reads.d.ts +81 -0
- package/dist/tools/cpu/lean-reads.js +262 -0
- package/dist/tools/cpu/lean-reads.js.map +1 -0
- package/dist/tools/cpu/level-set.d.ts +42 -3
- package/dist/tools/cpu/level-set.js +59 -7
- package/dist/tools/cpu/level-set.js.map +1 -1
- package/dist/tools/cpu/majorant.d.ts +265 -0
- package/dist/tools/cpu/majorant.js +541 -0
- package/dist/tools/cpu/majorant.js.map +1 -0
- package/dist/tools/cpu/march.d.ts +93 -2
- package/dist/tools/cpu/march.js +165 -14
- package/dist/tools/cpu/march.js.map +1 -1
- package/dist/tools/cpu/mesh-decimate.d.ts +124 -0
- package/dist/tools/cpu/mesh-decimate.js +1225 -0
- package/dist/tools/cpu/mesh-decimate.js.map +1 -0
- package/dist/tools/cpu/points.d.ts +29 -0
- package/dist/tools/cpu/points.js +38 -0
- package/dist/tools/cpu/points.js.map +1 -0
- package/dist/tools/cpu/read-value.d.ts +19 -6
- package/dist/tools/cpu/read-value.js +32 -17
- package/dist/tools/cpu/read-value.js.map +1 -1
- package/dist/tools/cpu/sample-trilinear.d.ts +17 -4
- package/dist/tools/cpu/sample-trilinear.js +19 -7
- package/dist/tools/cpu/sample-trilinear.js.map +1 -1
- package/dist/tools/cpu/stride-tables.d.ts +2 -2
- package/dist/tools/cpu/stride-tables.generated.d.ts +6 -5
- package/dist/tools/cpu/stride-tables.generated.js +7 -6
- package/dist/tools/cpu/stride-tables.generated.js.map +1 -1
- package/dist/tools/cpu/stride-tables.js +1 -1
- package/dist/tools/cpu/stride-tables.js.map +1 -1
- package/dist/tools/cpu/surface-nets.d.ts +90 -0
- package/dist/tools/cpu/surface-nets.js +597 -0
- package/dist/tools/cpu/surface-nets.js.map +1 -0
- package/dist/tools/errors.d.ts +9 -0
- package/dist/tools/errors.js +9 -0
- package/dist/tools/errors.js.map +1 -1
- package/dist/tools/frame/ambient.d.ts +98 -0
- package/dist/tools/frame/ambient.js +274 -0
- package/dist/tools/frame/ambient.js.map +1 -0
- package/dist/tools/frame/blackbody.d.ts +15 -0
- package/dist/tools/frame/blackbody.js +35 -0
- package/dist/tools/frame/blackbody.js.map +1 -1
- package/dist/tools/frame/brick-cache.d.ts +165 -0
- package/dist/tools/frame/brick-cache.js +326 -0
- package/dist/tools/frame/brick-cache.js.map +1 -0
- package/dist/tools/frame/emission.d.ts +9 -0
- package/dist/tools/frame/emission.js +9 -1
- package/dist/tools/frame/emission.js.map +1 -1
- package/dist/tools/frame/environment-gpu.d.ts +111 -0
- package/dist/tools/frame/environment-gpu.js +280 -0
- package/dist/tools/frame/environment-gpu.js.map +1 -0
- package/dist/tools/frame/environment.d.ts +3 -2
- package/dist/tools/frame/environment.js +8 -4
- package/dist/tools/frame/environment.js.map +1 -1
- package/dist/tools/frame/froxel.d.ts +58 -0
- package/dist/tools/frame/froxel.js +115 -0
- package/dist/tools/frame/froxel.js.map +1 -0
- package/dist/tools/frame/grid.d.ts +90 -0
- package/dist/tools/frame/grid.js +112 -13
- package/dist/tools/frame/grid.js.map +1 -1
- package/dist/tools/frame/index.d.ts +14 -0
- package/dist/tools/frame/index.js +45 -4
- package/dist/tools/frame/index.js.map +1 -1
- package/dist/tools/frame/medium.d.ts +16 -0
- package/dist/tools/frame/medium.js +3 -1
- package/dist/tools/frame/medium.js.map +1 -1
- package/dist/tools/frame/mie.d.ts +9 -0
- package/dist/tools/frame/mie.js +18 -0
- package/dist/tools/frame/mie.js.map +1 -1
- package/dist/tools/frame/mlp-nn.d.ts +36 -0
- package/dist/tools/frame/mlp-nn.js +159 -0
- package/dist/tools/frame/mlp-nn.js.map +1 -0
- package/dist/tools/frame/mlp-tza.d.ts +29 -0
- package/dist/tools/frame/mlp-tza.js +186 -0
- package/dist/tools/frame/mlp-tza.js.map +1 -0
- package/dist/tools/frame/mlp.d.ts +183 -0
- package/dist/tools/frame/mlp.js +434 -0
- package/dist/tools/frame/mlp.js.map +1 -0
- package/dist/tools/frame/ms-exit.d.ts +42 -0
- package/dist/tools/frame/ms-exit.js +90 -0
- package/dist/tools/frame/ms-exit.js.map +1 -0
- package/dist/tools/frame/multi-scale.d.ts +152 -0
- package/dist/tools/frame/multi-scale.js +302 -0
- package/dist/tools/frame/multi-scale.js.map +1 -0
- package/dist/tools/frame/neural-weights.d.ts +6 -5
- package/dist/tools/frame/neural-weights.js +234 -235
- package/dist/tools/frame/neural-weights.js.map +1 -1
- package/dist/tools/frame/neural.js +1 -1
- package/dist/tools/frame/neural.js.map +1 -1
- package/dist/tools/frame/occluders.d.ts +51 -0
- package/dist/tools/frame/occluders.js +72 -0
- package/dist/tools/frame/occluders.js.map +1 -0
- package/dist/tools/frame/pyramid-layout.d.ts +17 -0
- package/dist/tools/frame/pyramid-layout.js +47 -0
- package/dist/tools/frame/pyramid-layout.js.map +1 -1
- package/dist/tools/frame/shadows.d.ts +110 -0
- package/dist/tools/frame/shadows.js +286 -0
- package/dist/tools/frame/shadows.js.map +1 -1
- package/dist/tools/frame/sparse.d.ts +82 -0
- package/dist/tools/frame/sparse.js +242 -1
- package/dist/tools/frame/sparse.js.map +1 -1
- package/dist/tools/frame/spectral-stack.d.ts +159 -0
- package/dist/tools/frame/spectral-stack.js +391 -0
- package/dist/tools/frame/spectral-stack.js.map +1 -0
- package/dist/tools/frame/spectral.d.ts +21 -2
- package/dist/tools/frame/spectral.js +30 -8
- package/dist/tools/frame/spectral.js.map +1 -1
- package/dist/tools/frame/stack.d.ts +115 -0
- package/dist/tools/frame/stack.js +290 -0
- package/dist/tools/frame/stack.js.map +1 -0
- package/dist/tools/frame/view.d.ts +131 -0
- package/dist/tools/frame/view.js +337 -0
- package/dist/tools/frame/view.js.map +1 -0
- package/dist/tools/index.d.ts +66 -15
- package/dist/tools/index.js +55 -11
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/internal.d.ts +58 -17
- package/dist/tools/internal.js +65 -11
- package/dist/tools/internal.js.map +1 -1
- package/dist/tools/nanovdb/build-from-vdb.d.ts +11 -2
- package/dist/tools/nanovdb/build-from-vdb.js +10 -2
- package/dist/tools/nanovdb/build-from-vdb.js.map +1 -1
- package/dist/tools/nanovdb/bytes.d.ts +17 -4
- package/dist/tools/nanovdb/bytes.js +46 -3
- package/dist/tools/nanovdb/bytes.js.map +1 -1
- package/dist/tools/nanovdb/coarse-first.d.ts +19 -3
- package/dist/tools/nanovdb/coarse-first.js +7 -1
- package/dist/tools/nanovdb/coarse-first.js.map +1 -1
- package/dist/tools/nanovdb/half.d.ts +22 -0
- package/dist/tools/nanovdb/half.js +73 -0
- package/dist/tools/nanovdb/half.js.map +1 -0
- package/dist/tools/nanovdb/index.d.ts +3 -1
- package/dist/tools/nanovdb/index.js +2 -1
- package/dist/tools/nanovdb/index.js.map +1 -1
- package/dist/tools/nanovdb/inspect.d.ts +10 -1
- package/dist/tools/nanovdb/inspect.js +8 -1
- package/dist/tools/nanovdb/inspect.js.map +1 -1
- package/dist/tools/nanovdb/leaf-codec.d.ts +35 -1
- package/dist/tools/nanovdb/leaf-codec.js +40 -4
- package/dist/tools/nanovdb/leaf-codec.js.map +1 -1
- package/dist/tools/nanovdb/quantize.d.ts +39 -10
- package/dist/tools/nanovdb/quantize.js +96 -44
- package/dist/tools/nanovdb/quantize.js.map +1 -1
- package/dist/tools/nanovdb/resample.d.ts +20 -3
- package/dist/tools/nanovdb/resample.js +20 -7
- package/dist/tools/nanovdb/resample.js.map +1 -1
- package/dist/tools/nanovdb/serialize.d.ts +34 -3
- package/dist/tools/nanovdb/serialize.js +51 -7
- package/dist/tools/nanovdb/serialize.js.map +1 -1
- package/dist/tools/nanovdb/stats.d.ts +34 -5
- package/dist/tools/nanovdb/stats.js +87 -11
- package/dist/tools/nanovdb/stats.js.map +1 -1
- package/dist/tools/nanovdb/transform.d.ts +4 -0
- package/dist/tools/nanovdb/transform.js +3 -0
- package/dist/tools/nanovdb/transform.js.map +1 -1
- package/dist/tools/nanovdb/tree.d.ts +14 -3
- package/dist/tools/nanovdb/tree.js +25 -13
- package/dist/tools/nanovdb/tree.js.map +1 -1
- package/dist/tools/nanovdb/write-nvdb.d.ts +47 -12
- package/dist/tools/nanovdb/write-nvdb.js +108 -28
- package/dist/tools/nanovdb/write-nvdb.js.map +1 -1
- package/dist/tools/nvdb-file.d.ts +77 -7
- package/dist/tools/nvdb-file.js +177 -20
- package/dist/tools/nvdb-file.js.map +1 -1
- package/dist/tools/nvdb-stream.d.ts +23 -7
- package/dist/tools/nvdb-stream.js +78 -34
- package/dist/tools/nvdb-stream.js.map +1 -1
- package/dist/tools/reference/analytic.d.ts +41 -0
- package/dist/tools/reference/analytic.js +95 -0
- package/dist/tools/reference/analytic.js.map +1 -0
- package/dist/tools/reference/environment.d.ts +62 -0
- package/dist/tools/reference/environment.js +154 -0
- package/dist/tools/reference/environment.js.map +1 -0
- package/dist/tools/reference/index.d.ts +12 -0
- package/dist/tools/reference/index.js +13 -0
- package/dist/tools/reference/index.js.map +1 -0
- package/dist/tools/reference/media.d.ts +14 -0
- package/dist/tools/reference/media.js +30 -0
- package/dist/tools/reference/media.js.map +1 -0
- package/dist/tools/reference/rng.d.ts +20 -0
- package/dist/tools/reference/rng.js +30 -0
- package/dist/tools/reference/rng.js.map +1 -0
- package/dist/tools/reference/scene.d.ts +312 -0
- package/dist/tools/reference/scene.js +169 -0
- package/dist/tools/reference/scene.js.map +1 -0
- package/dist/tools/reference/tables.d.ts +98 -0
- package/dist/tools/reference/tables.js +264 -0
- package/dist/tools/reference/tables.js.map +1 -0
- package/dist/tools/reference/trace.d.ts +160 -0
- package/dist/tools/reference/trace.js +497 -0
- package/dist/tools/reference/trace.js.map +1 -0
- package/dist/tools/vdb/blosc-write.d.ts +43 -0
- package/dist/tools/vdb/blosc-write.js +197 -0
- package/dist/tools/vdb/blosc-write.js.map +1 -0
- package/dist/tools/vdb/blosc.d.ts +35 -5
- package/dist/tools/vdb/blosc.js +82 -26
- package/dist/tools/vdb/blosc.js.map +1 -1
- package/dist/tools/vdb/blosclz.d.ts +33 -0
- package/dist/tools/vdb/blosclz.js +112 -0
- package/dist/tools/vdb/blosclz.js.map +1 -0
- package/dist/tools/vdb/byte-reader.d.ts +13 -3
- package/dist/tools/vdb/byte-reader.js +26 -4
- package/dist/tools/vdb/byte-reader.js.map +1 -1
- package/dist/tools/vdb/compression.d.ts +13 -5
- package/dist/tools/vdb/compression.js +13 -2
- package/dist/tools/vdb/compression.js.map +1 -1
- package/dist/tools/vdb/grid.js +8 -2
- package/dist/tools/vdb/grid.js.map +1 -1
- package/dist/tools/vdb/index.d.ts +2 -1
- package/dist/tools/vdb/index.js.map +1 -1
- package/dist/tools/vdb/lz4.d.ts +30 -0
- package/dist/tools/vdb/lz4.js +228 -0
- package/dist/tools/vdb/lz4.js.map +1 -0
- package/dist/tools/vdb/metadata.js +1 -1
- package/dist/tools/vdb/metadata.js.map +1 -1
- package/dist/tools/vdb/parse.d.ts +24 -2
- package/dist/tools/vdb/parse.js +102 -32
- package/dist/tools/vdb/parse.js.map +1 -1
- package/dist/tools/vdb/point-render-data.d.ts +49 -1
- package/dist/tools/vdb/point-render-data.js +91 -11
- package/dist/tools/vdb/point-render-data.js.map +1 -1
- package/dist/tools/vdb/points.d.ts +26 -0
- package/dist/tools/vdb/points.js +46 -5
- package/dist/tools/vdb/points.js.map +1 -1
- package/dist/tools/vdb/types.d.ts +59 -2
- package/dist/tools/vdb/types.js.map +1 -1
- package/dist/tools/wvdb/bake.d.ts +38 -9
- package/dist/tools/wvdb/bake.js +63 -13
- package/dist/tools/wvdb/bake.js.map +1 -1
- package/dist/tools/wvdb/dense.d.ts +80 -1
- package/dist/tools/wvdb/dense.js +67 -8
- package/dist/tools/wvdb/dense.js.map +1 -1
- package/dist/tools/wvdb/format.d.ts +59 -0
- package/dist/tools/wvdb/format.js +3 -0
- package/dist/tools/wvdb/format.js.map +1 -1
- package/dist/tools/wvdb/index.d.ts +1 -0
- package/dist/tools/wvdb/index.js +1 -0
- package/dist/tools/wvdb/index.js.map +1 -1
- package/dist/tools/wvdb/level-set.d.ts +10 -2
- package/dist/tools/wvdb/level-set.js.map +1 -1
- package/dist/tools/wvdb/nanovdb.d.ts +6 -1
- package/dist/tools/wvdb/nanovdb.js +5 -1
- package/dist/tools/wvdb/nanovdb.js.map +1 -1
- package/dist/tools/wvdb/partial.d.ts +74 -0
- package/dist/tools/wvdb/partial.js +233 -0
- package/dist/tools/wvdb/partial.js.map +1 -0
- package/dist/tools/wvdb/read.d.ts +77 -1
- package/dist/tools/wvdb/read.js +30 -7
- package/dist/tools/wvdb/read.js.map +1 -1
- package/dist/tools/wvdb/write.d.ts +23 -1
- package/dist/tools/wvdb/write.js +8 -1
- package/dist/tools/wvdb/write.js.map +1 -1
- package/package.json +2 -1
- package/vendor/VENDOR.md +21 -6
- package/vendor/pnanovdb.wgsl +52 -14
- package/dist/three/frame/blackbody.d.ts +0 -42
- package/dist/three/frame/blackbody.js +0 -74
- package/dist/three/frame/blackbody.js.map +0 -1
- package/dist/three/frame/chunks.d.ts +0 -157
- package/dist/three/frame/chunks.js +0 -559
- package/dist/three/frame/chunks.js.map +0 -1
- package/dist/three/frame/density-material.d.ts +0 -53
- package/dist/three/frame/density-material.js +0 -353
- package/dist/three/frame/density-material.js.map +0 -1
- package/dist/three/frame/environment-grid-material.d.ts +0 -21
- package/dist/three/frame/environment-grid-material.js +0 -184
- package/dist/three/frame/environment-grid-material.js.map +0 -1
- package/dist/three/frame/environment-material.d.ts +0 -22
- package/dist/three/frame/environment-material.js +0 -87
- package/dist/three/frame/environment-material.js.map +0 -1
- package/dist/three/frame/grid-mip-material.d.ts +0 -12
- package/dist/three/frame/grid-mip-material.js +0 -61
- package/dist/three/frame/grid-mip-material.js.map +0 -1
- package/dist/three/frame/inject-material.d.ts +0 -56
- package/dist/three/frame/inject-material.js +0 -424
- package/dist/three/frame/inject-material.js.map +0 -1
- package/dist/three/frame/integrate-material.d.ts +0 -26
- package/dist/three/frame/integrate-material.js +0 -198
- package/dist/three/frame/integrate-material.js.map +0 -1
- package/dist/three/frame/layout.d.ts +0 -34
- package/dist/three/frame/layout.js +0 -48
- package/dist/three/frame/layout.js.map +0 -1
- package/dist/three/frame/lighting-material.d.ts +0 -41
- package/dist/three/frame/lighting-material.js +0 -257
- package/dist/three/frame/lighting-material.js.map +0 -1
- package/dist/three/frame/lights.d.ts +0 -11
- package/dist/three/frame/lights.js +0 -16
- package/dist/three/frame/lights.js.map +0 -1
- package/dist/three/frame/neural.d.ts +0 -14
- package/dist/three/frame/neural.js +0 -105
- package/dist/three/frame/neural.js.map +0 -1
- package/dist/three/frame/phase.d.ts +0 -44
- package/dist/three/frame/phase.js +0 -80
- package/dist/three/frame/phase.js.map +0 -1
- package/dist/three/frame/shadow-density-material.d.ts +0 -30
- package/dist/three/frame/shadow-density-material.js +0 -123
- package/dist/three/frame/shadow-density-material.js.map +0 -1
- package/dist/three/frame/temporal-material.d.ts +0 -29
- package/dist/three/frame/temporal-material.js +0 -152
- package/dist/three/frame/temporal-material.js.map +0 -1
- package/dist/three/frame/transmittance-material.d.ts +0 -31
- package/dist/three/frame/transmittance-material.js +0 -315
- package/dist/three/frame/transmittance-material.js.map +0 -1
- package/dist/three/frame/view.d.ts +0 -103
- package/dist/three/frame/view.js +0 -296
- package/dist/three/frame/view.js.map +0 -1
- package/dist/three/frame/volume-shadow-material.d.ts +0 -36
- package/dist/three/frame/volume-shadow-material.js +0 -128
- package/dist/three/frame/volume-shadow-material.js.map +0 -1
- package/dist/three/sequence.js.map +0 -1
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings of the core frame renderer (K6.1, design §2.2): his `frameRenderer.settings` (the same names, meanings
|
|
3
|
+
* and v0.26 defaults), plus the K6 fields. Since K6.8 `@pmndrs/vdb/three`'s `VDBFrameRenderer.settings` is this type
|
|
4
|
+
* (one declaration).
|
|
5
|
+
*/
|
|
6
|
+
/** Phase functions (his `phase`). */
|
|
7
|
+
export type VDBFramePhaseName = "isotropic" | "henyey-greenstein" | "dual-lobe" | "lorenz-mie" | "lorenz-mie-rgb";
|
|
8
|
+
/**
|
|
9
|
+
* Multiple scattering modes (his `multipleScattering`, plus K6.3: `'mlp'` and `'multi-scale'` (K7.3, his 4e2d46f)).
|
|
10
|
+
* `'neural'` and `'mlp'` are EXPERIMENTAL: both run the core's generic small-MLP evaluator on `renderer.mlp` (our
|
|
11
|
+
* trained network by default, K6.N), whose data shape may change before 1.0.
|
|
12
|
+
*/
|
|
13
|
+
export type VDBFrameMultipleScatteringMode = boolean | "two-sided" | "octaves" | "neural" | "mlp" | "multi-scale";
|
|
14
|
+
/**
|
|
15
|
+
* The renderer's settings (`vdbFrameDefaultSettings()`; his `frameRenderer.settings`, K6.10a: each field's doc ported
|
|
16
|
+
* from the deleted `./three` `VDBFrameRendererSettings`). Values out of the device's range clamp with a one-time
|
|
17
|
+
* warning (`shadowResolution`, `castShadowMapSize`).
|
|
18
|
+
*/
|
|
19
|
+
export interface VDBFrameSettings {
|
|
20
|
+
/** Froxel grid width (default 512). */
|
|
21
|
+
width: number;
|
|
22
|
+
/** Froxel grid height (default 512). */
|
|
23
|
+
height: number;
|
|
24
|
+
/** N > 0: at most one froxel per N x N viewport pixels. 0: no cap. */
|
|
25
|
+
pixelsPerFroxel: number;
|
|
26
|
+
/** Slices (default 24). */
|
|
27
|
+
depth: number;
|
|
28
|
+
/** Most sub-steps across one slice (default 32). */
|
|
29
|
+
subSteps: number;
|
|
30
|
+
/** Near distance of the froxel slices in view units (default 0.1). */
|
|
31
|
+
near: number;
|
|
32
|
+
/** Far distance of the froxel slices in view units (default Infinity: the camera far plane). */
|
|
33
|
+
far: number;
|
|
34
|
+
/** View distance where the density fades to 0 (FogExp2-like). Infinity: no fade. */
|
|
35
|
+
fadeRadius: number;
|
|
36
|
+
/** Golden-ratio jitter of the sub-steps, shadow start and grid marches (default false). */
|
|
37
|
+
jitter: boolean;
|
|
38
|
+
/** His froxel reprojection with a neighbourhood clamp (default true, his; V33). */
|
|
39
|
+
temporal: boolean;
|
|
40
|
+
/** History weight of the temporal pass (0.01–1; his default 0.2). */
|
|
41
|
+
temporalBlend: number;
|
|
42
|
+
/** `'volume'`: each volume lights itself with its own shadow march. `'frame'`: the world shadow grid (default, his; V33). */
|
|
43
|
+
lighting: "volume" | "frame";
|
|
44
|
+
/**
|
|
45
|
+
* `'frame'` lighting: voxels on each side of each shadow grid cascade (default 64). Clamped (warned once) to what the
|
|
46
|
+
* device holds: the transmittance stack must tile in `maxTextureDimension3D` and fit `maxBufferSize` (K6.8, K6.10a).
|
|
47
|
+
*/
|
|
48
|
+
shadowResolution: number;
|
|
49
|
+
/**
|
|
50
|
+
* K6.Q1b: `'frame'` lighting: a size-adaptive shadow grid, up to this many voxels per side (default 0: off, the grid
|
|
51
|
+
* is `shadowResolution`). Above `shadowResolution`, the grid grows until a cell spans at most 16 of a caster's voxels
|
|
52
|
+
* and 2 optical depths at its mean density (a large sparse cloud, a dense medium; a small thin one keeps
|
|
53
|
+
* `shadowResolution`). Memory grows
|
|
54
|
+
* with the cube of the side (about 48 B per voxel grey: R 128 ≈ 96 MiB, 64 ≈ 12 MiB) and the transmittance pass with
|
|
55
|
+
* about its fourth power, but it is redrawn only when the lights or the casters change (every frame with `jitter`).
|
|
56
|
+
* A host can read the side in use from `shadowGridResolution`.
|
|
57
|
+
*/
|
|
58
|
+
shadowResolutionMax: number;
|
|
59
|
+
/** `'frame'` lighting: shadow grid cascades, 1–4 (default 1). */
|
|
60
|
+
shadowCascades: number;
|
|
61
|
+
/** `'frame'` lighting: half size of the finest cascades around the camera (default 512). */
|
|
62
|
+
shadowDistance: number;
|
|
63
|
+
/**
|
|
64
|
+
* The phase of every volume this renderer draws (default 'dual-lobe' 0.8 / -0.3 / 0.2 since 0.2.0, D39: a forward
|
|
65
|
+
* lobe `phaseG` and a back lobe `phaseBackG` of weight `phaseBackWeight`; `'henyey-greenstein'` is the 0.1 default, one
|
|
66
|
+
* forward lobe), and of `phaseG` … `phaseGExponent`: `'frame'` lighting lights all volumes with it in one pass; in `'volume'` lighting
|
|
67
|
+
* a volume's own phase parameters override it where set.
|
|
68
|
+
*/
|
|
69
|
+
phase: VDBFramePhaseName;
|
|
70
|
+
/** Henyey-Greenstein asymmetry `g` of the forward lobe (default 0.8). */
|
|
71
|
+
phaseG: number;
|
|
72
|
+
/** `g` of the backward lobe of the dual-lobe phases (default -0.3). */
|
|
73
|
+
phaseBackG: number;
|
|
74
|
+
/** Weight of the backward lobe of the dual-lobe phases (default 0.2). */
|
|
75
|
+
phaseBackWeight: number;
|
|
76
|
+
/** Wavelength exponent of `g` in spectral rendering (default 0: the same `g` in every channel). */
|
|
77
|
+
phaseGExponent: number;
|
|
78
|
+
/** Blend the volumes over the scene in sRGB, as WebGLRenderer (default true). false blends in linear space. */
|
|
79
|
+
srgbBlending: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* `'frame'` lighting: the environment as lights: `'outward'` (SH irradiance along each volume's outward direction),
|
|
82
|
+
* `'directional'` (≤ 8 lights from a 64 × 32 map, default) or `'spherical-harmonics'` (SH quadrature lights).
|
|
83
|
+
*/
|
|
84
|
+
environmentLighting: "outward" | "directional" | "spherical-harmonics";
|
|
85
|
+
/** Lights of `'directional'` (1–8, default 8). */
|
|
86
|
+
environmentSamples: number;
|
|
87
|
+
/** SH order of `'spherical-harmonics'` (1 or 2, default 1). */
|
|
88
|
+
environmentShOrder: number;
|
|
89
|
+
/**
|
|
90
|
+
* Multiple scattering in the shadow marches: false (single scattering), true (1D diffusion toward the light),
|
|
91
|
+
* `'two-sided'` (2D slab diffusion toward and away from the light), `'octaves'` (indirect light octaves,
|
|
92
|
+
* `scatteringOctave*`), `'multi-scale'` (diffusion from mips of the shadow grid, `multiScaleLevels`; 'frame'
|
|
93
|
+
* lighting) or `'neural'` (default: the scattered light of the scene light slots from our small trained network, K6.N,
|
|
94
|
+
* in `'frame'` lighting, diffusion elsewhere). `'neural'` and `'mlp'` (the same evaluator by its own name) are
|
|
95
|
+
* EXPERIMENTAL: they run the generic small-MLP evaluator on `renderer.mlp` (null: 1D diffusion), whose data shape may
|
|
96
|
+
* change before 1.0.
|
|
97
|
+
*/
|
|
98
|
+
multipleScattering: VDBFrameMultipleScatteringMode;
|
|
99
|
+
/** `'octaves'`: octaves N (1–8, default 4). Octave n has extinction × aⁿ, light × bⁿ, phase g × cⁿ. */
|
|
100
|
+
scatteringOctaves: number;
|
|
101
|
+
/** `'octaves'`: a (0–1, default 0.5). */
|
|
102
|
+
scatteringOctaveExtinction: number;
|
|
103
|
+
/** `'octaves'`: b (0–1, default 0.5). */
|
|
104
|
+
scatteringOctaveContribution: number;
|
|
105
|
+
/** `'octaves'`: c (0–1, default 0.5). */
|
|
106
|
+
scatteringOctavePhase: number;
|
|
107
|
+
/**
|
|
108
|
+
* Spectral media (his `spectral`, default false): per-channel extinction (each volume's `extinctionScale` ×
|
|
109
|
+
* (λ / 550)^−`angstromExponent`), per-channel albedo and multiple scattering. 'frame' lighting draws one
|
|
110
|
+
* transmittance pass per slot group; the froxels get a second texture. K7.4a: `'neural'` / `'mlp'` run the network
|
|
111
|
+
* once per channel (his `isNeural` ran them as 1D diffusion; a grey medium renders as with spectral off); K7.4a-3:
|
|
112
|
+
* `'multi-scale'` runs its lookup once per channel too.
|
|
113
|
+
*/
|
|
114
|
+
spectral: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Volumes cast shadows on meshes (his `castShadows`, default false), for directional, point and spot lights that ask
|
|
117
|
+
* for a map: Beer shadow maps from the world shadow grid's last cascade, read by the host's receivers
|
|
118
|
+
* (`vdbVolumeShadowWgsl`; `./three` multiplies them into each light's shadow).
|
|
119
|
+
*/
|
|
120
|
+
castShadows: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Texels on each side of a volume shadow map (each cascade tile and cube face; default 512). Clamped (warned once)
|
|
123
|
+
* to `maxTextureDimension2D` and to a map whose zero-fill staging fits `maxBufferSize` (a point light's 6 faces
|
|
124
|
+
* count; K6.10a).
|
|
125
|
+
*/
|
|
126
|
+
castShadowMapSize: number;
|
|
127
|
+
/** Directional lights: cascades of the volume shadow map (1–4, default 1). */
|
|
128
|
+
castShadowCascades: number;
|
|
129
|
+
/** Directional lights: the largest view distance the cascades cover (default 4000). */
|
|
130
|
+
castShadowDistance: number;
|
|
131
|
+
/** Grid samples on each light ray of a volume shadow map (1–256, default 32). */
|
|
132
|
+
castShadowSteps: number;
|
|
133
|
+
/** Map pieces drawn again in one update (a cascade tile or spot map 1, a cube map 6; default 1). */
|
|
134
|
+
castShadowUpdatesPerFrame: number;
|
|
135
|
+
/** Very small maps (64) and few samples (8): soft blob shadows at almost no cost (default false). */
|
|
136
|
+
castShadowCoarse: boolean;
|
|
137
|
+
/** K6.3 `'multi-scale'`: levels read, base included (2–8; his `multiScaleLevels`, default 6). */
|
|
138
|
+
multiScaleLevels: number;
|
|
139
|
+
/**
|
|
140
|
+
* K6.5b: the host's depth shadow maps (`VDBFrameInput.occluders`) shadow the volumes (mesh → volume shadows: the
|
|
141
|
+
* 'frame' transmittance and gather, the 'volume' march). Default true; it does nothing without maps.
|
|
142
|
+
*/
|
|
143
|
+
occlusion: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* K6.Q1 (V85): shadowed ambient. Ambient, hemisphere and light-probe light (and 'frame' lighting's 'outward'
|
|
146
|
+
* environment) is attenuated by the medium: transmittance marched along `ambientOcclusionPairs` opposite direction
|
|
147
|
+
* pairs, averaged per hemisphere around the sky direction, each the lighting mode's isotropic-light total (white
|
|
148
|
+
* furnace with multiple scattering). 'frame' lighting marches them in the transmittance pass (a grid lookup in the
|
|
149
|
+
* gather); 'volume' lighting per froxel through the volume's shadow march. Default true (D35): the unshadowed light
|
|
150
|
+
* of his renderer was +35 to +148 % too bright in single scattering (the K6.R reference). `false` gives his unshadowed
|
|
151
|
+
* ambient, hemisphere and probe light.
|
|
152
|
+
*/
|
|
153
|
+
ambientOcclusion: boolean;
|
|
154
|
+
/** K6.Q1: direction pairs of the shadowed ambient (1–8; 1: ± the sky direction only). */
|
|
155
|
+
ambientOcclusionPairs: number;
|
|
156
|
+
/** K6.Q1: march steps of each 'volume'-lighting ambient direction (0: the volume's `shadowSteps`). */
|
|
157
|
+
ambientOcclusionSteps: number;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* K6.8: the settings the renderer also reads that are not public in 0.2.0 (A/B settings of 'multi-scale'; K6.3a
|
|
161
|
+
* recommends dropping multi-scale as a default candidate, the owner decides). The renderer's settings object has them
|
|
162
|
+
* (`vdbFrameDefaultSettings()` makes them); set them through this type (`core/internal.ts`).
|
|
163
|
+
*/
|
|
164
|
+
export interface VDBFrameInternalSettings extends VDBFrameSettings {
|
|
165
|
+
/**
|
|
166
|
+
* K6.3 `'multi-scale'`: the mip edge rule (V75): `'zero'` (default; density outside the grid is 0) or his
|
|
167
|
+
* `'clamp'` (clamp-to-edge). An A/B setting for K6.R1.
|
|
168
|
+
*/
|
|
169
|
+
multiScaleEdge: "zero" | "clamp";
|
|
170
|
+
/**
|
|
171
|
+
* K6.3a `'multi-scale'`: the blur of each level (V75 item 5). `'his'` (default; his 4e2d46f): level k reads the
|
|
172
|
+
* binomial mip k, σ ≈ 2^(k−1) voxels. `'paper'`: level k reads mip k + 1, σ ≈ 2^k voxels (Disney "Deep Scattering"
|
|
173
|
+
* §4.2: the Gaussian width equals the level's stencil spacing); the chain holds one more mip. An A/B setting.
|
|
174
|
+
*/
|
|
175
|
+
multiScaleSigma: "his" | "paper";
|
|
176
|
+
/**
|
|
177
|
+
* K6.Q1b: the cell rule of the size-adaptive shadow grid (`shadowResolutionMax`): `'both'` (default: the finer of the
|
|
178
|
+
* two), `'optical'` (2 optical depths per cell at the mean density) or `'voxels'` (16 source voxels per cell). An A/B
|
|
179
|
+
* setting.
|
|
180
|
+
*/
|
|
181
|
+
shadowResolutionRule: "both" | "optical" | "voxels";
|
|
182
|
+
/**
|
|
183
|
+
* K6.Q1c / K6.Q1d / K6.Q1d-a (V128, D41): the phase weight of the shadowed distant light (ambient, hemisphere, probe;
|
|
184
|
+
* 'frame' lighting's 'outward' environment) with `ambientOcclusion`, both lightings. `'dipole'` (default): a dipole
|
|
185
|
+
* fit to the pair totals, T(ω) ≈ a + b·ω, weighted by each phase lobe's mean cosine g: every distant term ×
|
|
186
|
+
* Σ_lobes w_i clamp(a + g_i b·r, 0, 1) / a (r the view ray), except on diffusion totals (any multiple scattering but
|
|
187
|
+
* `'octaves'`: isotropic, the white furnace holds). `'isotropic'` (K6.Q1): the solid-angle mean of the pair totals.
|
|
188
|
+
* 'volume' lighting fits the dipole per froxel in the gather. 'frame' lighting stores b per shadow-grid voxel in the
|
|
189
|
+
* transmittance stack (one more rgba16float target per cascade, +8 B per voxel; spectral: 3 targets, +24 B), only
|
|
190
|
+
* while something reads it (`vdbFrameDipoleTargetsWanted`: distant light, `ambientOcclusion`, multiple scattering
|
|
191
|
+
* off or `'octaves'`); b is view-independent (no redraw on camera moves). Internal: the public switch is
|
|
192
|
+
* `ambientOcclusion` (K6-Q1d-a handoff).
|
|
193
|
+
*/
|
|
194
|
+
ambientPhase: "isotropic" | "dipole";
|
|
195
|
+
/**
|
|
196
|
+
* K6.Na: the evaluator of `'neural'` / `'mlp'` (EXPERIMENTAL). `'generic'` (default, K6.3): scalar loops over a flat
|
|
197
|
+
* weight array. `'packed'`: the layer layout of the pmndrs neural tooling (pmndrs/denoiser `denoiser-wgsl`: mat4x4 per
|
|
198
|
+
* output group and input chunk, `mat4x4f * vec4f`, vec4 activations), the same network to f32 rounding. An A/B setting
|
|
199
|
+
* (K6-Na handoff); DECISIONS changes only after the A/B.
|
|
200
|
+
*/
|
|
201
|
+
mlpRuntime: "generic" | "packed";
|
|
202
|
+
/**
|
|
203
|
+
* K6.Nb: the feature reaches of `'neural'` / `'mlp'` (EXPERIMENTAL). `'grid'` (K6.N, his): h 2^k with h the last shadow
|
|
204
|
+
* grid cascade's voxel, so the network's inputs move with the grid side (`shadowResolution`, `shadowResolutionMax`).
|
|
205
|
+
* `'world'` (default since K6.Nb): the voxel the last cascade would have at side 64 (the networks' training side), read
|
|
206
|
+
* at the mip level of the same reach (`tools/frame/mlp.ts` `vdbFrameMlpReach`): the inputs stay put across sides, and at
|
|
207
|
+
* side 64 the two are the same numbers. The K6.Nb reference A/B (16 groups): mean |bias| 10.9 % against 11.5 % at the
|
|
208
|
+
* adaptive side, 11.1 % against 11.9 % at side 128, identical at 64 (K6-Nb handoff).
|
|
209
|
+
*/
|
|
210
|
+
mlpReach: "grid" | "world";
|
|
211
|
+
/**
|
|
212
|
+
* K7.4d-a (issue #66): the boxes of the `'neural'` / `'mlp'` feature levels (EXPERIMENTAL). `'voxel'` (default, K6.3,
|
|
213
|
+
* his): level k is a box of 2^k VOXELS per axis, while its input is log(1 + σ h 2^k) with h the largest voxel side, so
|
|
214
|
+
* on a last cascade with non-cubic voxels (each axis snaps to its own power of two) the box is narrower than its input
|
|
215
|
+
* says. `'cubic'`: the chain starts with an anisotropic step (2^e voxels per axis, `tools/frame/mlp.ts`
|
|
216
|
+
* `vdbFrameMlpCubicReduce`), so every level is a cube of side h 2^k; level 0 is read from the chain too. With cubic
|
|
217
|
+
* voxels the two are the same chain. An A/B setting (K7-4d-a handoff); DECISIONS changes only after the A/B.
|
|
218
|
+
*/
|
|
219
|
+
mlpFeatures: "voxel" | "cubic";
|
|
220
|
+
/**
|
|
221
|
+
* Issue #2 step 2: how the slice march (both lightings) reads the density. `'trilinear'` (default): the source's
|
|
222
|
+
* filter. `'stochastic'` (Pharr et al. 2024): at lod 0 one voxel of the trilinear cell, picked with its weight from
|
|
223
|
+
* three uniforms per sub-step (`vdbFrameRand3`: the froxel, the volume and step, the frame id), so a sparse source
|
|
224
|
+
* reads one voxel instead of eight; temporal accumulation averages the picks. exp(−Σσ dt) is not linear in σ, so
|
|
225
|
+
* the mean transmittance is biased upward (Jensen; V182): measure before a default. An A/B setting (K6.S2).
|
|
226
|
+
*/
|
|
227
|
+
densityFilter: "trilinear" | "stochastic";
|
|
228
|
+
/**
|
|
229
|
+
* K7.4c (V229): the exit of a scene light's scattered part (total − direct of any multiple-scattering mode but octaves,
|
|
230
|
+
* whose octaves are phased already), both lightings. `'isotropic'` (default): his isotropic exit. `'dipole'` / `'hg'`:
|
|
231
|
+
* the scattered radiance's mean cosine along the light's travel, μ = (D^{1 − α ḡ} − D) / S clamped to [0, ḡ] (D the
|
|
232
|
+
* direct transmittance, S the scattered total, α the albedo, ḡ the phase's mean cosine: small-angle transport with
|
|
233
|
+
* Poisson scattering orders), weights the scattered part by mix_i max(1 + 3 g_i μ cos θ, 0) (`'dipole'`, the K6.Q1c form)
|
|
234
|
+
* or mix_i HG(g_i μ, cos θ) (`'hg'`, the HG convolution). An A/B setting (K7-4bc handoff, `tools/frame/ms-exit.ts`).
|
|
235
|
+
* K7.4a-2 `'hg-chroma'`: the `'hg'` factor of each channel over the green channel's, so only the chromatic part of the
|
|
236
|
+
* exit acts (media whose g differs per channel: `phaseGExponent`); green and grey media exit as `'isotropic'`.
|
|
237
|
+
*/
|
|
238
|
+
msExit: "isotropic" | "dipole" | "hg" | "hg-chroma";
|
|
239
|
+
}
|
|
240
|
+
/** His v0.26 defaults (`FrameRenderer.js` L191–246, as `VDBFrameRenderer.settings`), plus `occlusion: true` and the K6.Q1 ambient occlusion (on since D35). */
|
|
241
|
+
export declare function vdbFrameDefaultSettings(): VDBFrameSettings;
|
|
242
|
+
/** The defaults with the internal fields typed ({@link VDBFrameInternalSettings}). */
|
|
243
|
+
export declare function vdbFrameDefaultInternalSettings(): VDBFrameInternalSettings;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):
|
|
2
|
+
// src/three-openvdb/frame/webgpu/FrameRenderer.js L191–246 (the settings: names, meanings and defaults).
|
|
3
|
+
// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).
|
|
4
|
+
// Changes: engine-free (K6.1); the K6 fields (occlusion, ambient occlusion, multi-scale, the adaptive shadow grid).
|
|
5
|
+
// Divergences: DIVERGES.md V33, V67, K6.1 rows.
|
|
6
|
+
/** His v0.26 defaults (`FrameRenderer.js` L191–246, as `VDBFrameRenderer.settings`), plus `occlusion: true` and the K6.Q1 ambient occlusion (on since D35). */
|
|
7
|
+
export function vdbFrameDefaultSettings() {
|
|
8
|
+
return vdbFrameDefaultInternalSettings();
|
|
9
|
+
}
|
|
10
|
+
/** The defaults with the internal fields typed ({@link VDBFrameInternalSettings}). */
|
|
11
|
+
export function vdbFrameDefaultInternalSettings() {
|
|
12
|
+
return {
|
|
13
|
+
width: 512,
|
|
14
|
+
height: 512,
|
|
15
|
+
pixelsPerFroxel: 0,
|
|
16
|
+
depth: 24,
|
|
17
|
+
subSteps: 32,
|
|
18
|
+
near: 0.1,
|
|
19
|
+
far: Infinity,
|
|
20
|
+
fadeRadius: Infinity,
|
|
21
|
+
jitter: false,
|
|
22
|
+
temporal: true,
|
|
23
|
+
temporalBlend: 0.2,
|
|
24
|
+
lighting: "frame",
|
|
25
|
+
shadowResolution: 64,
|
|
26
|
+
shadowResolutionMax: 0,
|
|
27
|
+
shadowCascades: 1,
|
|
28
|
+
shadowDistance: 512,
|
|
29
|
+
phase: "dual-lobe",
|
|
30
|
+
phaseG: 0.8,
|
|
31
|
+
phaseBackG: -0.3,
|
|
32
|
+
phaseBackWeight: 0.2,
|
|
33
|
+
phaseGExponent: 0.0,
|
|
34
|
+
srgbBlending: true,
|
|
35
|
+
environmentLighting: "directional",
|
|
36
|
+
environmentSamples: 8,
|
|
37
|
+
environmentShOrder: 1,
|
|
38
|
+
multipleScattering: "neural",
|
|
39
|
+
scatteringOctaves: 4,
|
|
40
|
+
scatteringOctaveExtinction: 0.5,
|
|
41
|
+
scatteringOctaveContribution: 0.5,
|
|
42
|
+
scatteringOctavePhase: 0.5,
|
|
43
|
+
spectral: false,
|
|
44
|
+
castShadows: false,
|
|
45
|
+
castShadowMapSize: 512,
|
|
46
|
+
castShadowCascades: 1,
|
|
47
|
+
castShadowDistance: 4000,
|
|
48
|
+
castShadowSteps: 32,
|
|
49
|
+
castShadowUpdatesPerFrame: 1,
|
|
50
|
+
castShadowCoarse: false,
|
|
51
|
+
multiScaleLevels: 6,
|
|
52
|
+
multiScaleEdge: "zero",
|
|
53
|
+
multiScaleSigma: "his",
|
|
54
|
+
shadowResolutionRule: "both",
|
|
55
|
+
ambientPhase: "dipole",
|
|
56
|
+
mlpRuntime: "generic",
|
|
57
|
+
mlpReach: "world",
|
|
58
|
+
mlpFeatures: "voxel",
|
|
59
|
+
densityFilter: "trilinear",
|
|
60
|
+
msExit: "isotropic",
|
|
61
|
+
occlusion: true,
|
|
62
|
+
ambientOcclusion: true,
|
|
63
|
+
ambientOcclusionPairs: 4,
|
|
64
|
+
ambientOcclusionSteps: 0,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/core/frame/settings.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,2GAA2G;AAC3G,4GAA4G;AAC5G,oHAAoH;AACpH,gDAAgD;AAsPhD,+JAA+J;AAC/J,MAAM,UAAU,uBAAuB;IACrC,OAAO,+BAA+B,EAAE,CAAC;AAC3C,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,eAAe,EAAE,CAAC;QAClB,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,QAAQ;QACb,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,GAAG;QAClB,QAAQ,EAAE,OAAO;QACjB,gBAAgB,EAAE,EAAE;QACpB,mBAAmB,EAAE,CAAC;QACtB,cAAc,EAAE,CAAC;QACjB,cAAc,EAAE,GAAG;QACnB,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,CAAC,GAAG;QAChB,eAAe,EAAE,GAAG;QACpB,cAAc,EAAE,GAAG;QACnB,YAAY,EAAE,IAAI;QAClB,mBAAmB,EAAE,aAAa;QAClC,kBAAkB,EAAE,CAAC;QACrB,kBAAkB,EAAE,CAAC;QACrB,kBAAkB,EAAE,QAAQ;QAC5B,iBAAiB,EAAE,CAAC;QACpB,0BAA0B,EAAE,GAAG;QAC/B,4BAA4B,EAAE,GAAG;QACjC,qBAAqB,EAAE,GAAG;QAC1B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,KAAK;QAClB,iBAAiB,EAAE,GAAG;QACtB,kBAAkB,EAAE,CAAC;QACrB,kBAAkB,EAAE,IAAI;QACxB,eAAe,EAAE,EAAE;QACnB,yBAAyB,EAAE,CAAC;QAC5B,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE,CAAC;QACnB,cAAc,EAAE,MAAM;QACtB,eAAe,EAAE,KAAK;QACtB,oBAAoB,EAAE,MAAM;QAC5B,YAAY,EAAE,QAAQ;QACtB,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,OAAO;QACpB,aAAa,EAAE,WAAW;QAC1B,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE,IAAI;QACtB,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;KACzB,CAAC;AACJ,CAAC","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/FrameRenderer.js L191–246 (the settings: names, meanings and defaults).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: engine-free (K6.1); the K6 fields (occlusion, ambient occlusion, multi-scale, the adaptive shadow grid).\n// Divergences: DIVERGES.md V33, V67, K6.1 rows.\n\n/**\n * The settings of the core frame renderer (K6.1, design §2.2): his `frameRenderer.settings` (the same names, meanings\n * and v0.26 defaults), plus the K6 fields. Since K6.8 `@pmndrs/vdb/three`'s `VDBFrameRenderer.settings` is this type\n * (one declaration).\n */\n\n/** Phase functions (his `phase`). */\nexport type VDBFramePhaseName = \"isotropic\" | \"henyey-greenstein\" | \"dual-lobe\" | \"lorenz-mie\" | \"lorenz-mie-rgb\";\n\n/**\n * Multiple scattering modes (his `multipleScattering`, plus K6.3: `'mlp'` and `'multi-scale'` (K7.3, his 4e2d46f)).\n * `'neural'` and `'mlp'` are EXPERIMENTAL: both run the core's generic small-MLP evaluator on `renderer.mlp` (our\n * trained network by default, K6.N), whose data shape may change before 1.0.\n */\nexport type VDBFrameMultipleScatteringMode = boolean | \"two-sided\" | \"octaves\" | \"neural\" | \"mlp\" | \"multi-scale\";\n\n/**\n * The renderer's settings (`vdbFrameDefaultSettings()`; his `frameRenderer.settings`, K6.10a: each field's doc ported\n * from the deleted `./three` `VDBFrameRendererSettings`). Values out of the device's range clamp with a one-time\n * warning (`shadowResolution`, `castShadowMapSize`).\n */\nexport interface VDBFrameSettings {\n /** Froxel grid width (default 512). */\n width: number;\n /** Froxel grid height (default 512). */\n height: number;\n /** N > 0: at most one froxel per N x N viewport pixels. 0: no cap. */\n pixelsPerFroxel: number;\n /** Slices (default 24). */\n depth: number;\n /** Most sub-steps across one slice (default 32). */\n subSteps: number;\n /** Near distance of the froxel slices in view units (default 0.1). */\n near: number;\n /** Far distance of the froxel slices in view units (default Infinity: the camera far plane). */\n far: number;\n /** View distance where the density fades to 0 (FogExp2-like). Infinity: no fade. */\n fadeRadius: number;\n /** Golden-ratio jitter of the sub-steps, shadow start and grid marches (default false). */\n jitter: boolean;\n /** His froxel reprojection with a neighbourhood clamp (default true, his; V33). */\n temporal: boolean;\n /** History weight of the temporal pass (0.01–1; his default 0.2). */\n temporalBlend: number;\n /** `'volume'`: each volume lights itself with its own shadow march. `'frame'`: the world shadow grid (default, his; V33). */\n lighting: \"volume\" | \"frame\";\n /**\n * `'frame'` lighting: voxels on each side of each shadow grid cascade (default 64). Clamped (warned once) to what the\n * device holds: the transmittance stack must tile in `maxTextureDimension3D` and fit `maxBufferSize` (K6.8, K6.10a).\n */\n shadowResolution: number;\n /**\n * K6.Q1b: `'frame'` lighting: a size-adaptive shadow grid, up to this many voxels per side (default 0: off, the grid\n * is `shadowResolution`). Above `shadowResolution`, the grid grows until a cell spans at most 16 of a caster's voxels\n * and 2 optical depths at its mean density (a large sparse cloud, a dense medium; a small thin one keeps\n * `shadowResolution`). Memory grows\n * with the cube of the side (about 48 B per voxel grey: R 128 ≈ 96 MiB, 64 ≈ 12 MiB) and the transmittance pass with\n * about its fourth power, but it is redrawn only when the lights or the casters change (every frame with `jitter`).\n * A host can read the side in use from `shadowGridResolution`.\n */\n shadowResolutionMax: number;\n /** `'frame'` lighting: shadow grid cascades, 1–4 (default 1). */\n shadowCascades: number;\n /** `'frame'` lighting: half size of the finest cascades around the camera (default 512). */\n shadowDistance: number;\n /**\n * The phase of every volume this renderer draws (default 'dual-lobe' 0.8 / -0.3 / 0.2 since 0.2.0, D39: a forward\n * lobe `phaseG` and a back lobe `phaseBackG` of weight `phaseBackWeight`; `'henyey-greenstein'` is the 0.1 default, one\n * forward lobe), and of `phaseG` … `phaseGExponent`: `'frame'` lighting lights all volumes with it in one pass; in `'volume'` lighting\n * a volume's own phase parameters override it where set.\n */\n phase: VDBFramePhaseName;\n /** Henyey-Greenstein asymmetry `g` of the forward lobe (default 0.8). */\n phaseG: number;\n /** `g` of the backward lobe of the dual-lobe phases (default -0.3). */\n phaseBackG: number;\n /** Weight of the backward lobe of the dual-lobe phases (default 0.2). */\n phaseBackWeight: number;\n /** Wavelength exponent of `g` in spectral rendering (default 0: the same `g` in every channel). */\n phaseGExponent: number;\n /** Blend the volumes over the scene in sRGB, as WebGLRenderer (default true). false blends in linear space. */\n srgbBlending: boolean;\n /**\n * `'frame'` lighting: the environment as lights: `'outward'` (SH irradiance along each volume's outward direction),\n * `'directional'` (≤ 8 lights from a 64 × 32 map, default) or `'spherical-harmonics'` (SH quadrature lights).\n */\n environmentLighting: \"outward\" | \"directional\" | \"spherical-harmonics\";\n /** Lights of `'directional'` (1–8, default 8). */\n environmentSamples: number;\n /** SH order of `'spherical-harmonics'` (1 or 2, default 1). */\n environmentShOrder: number;\n /**\n * Multiple scattering in the shadow marches: false (single scattering), true (1D diffusion toward the light),\n * `'two-sided'` (2D slab diffusion toward and away from the light), `'octaves'` (indirect light octaves,\n * `scatteringOctave*`), `'multi-scale'` (diffusion from mips of the shadow grid, `multiScaleLevels`; 'frame'\n * lighting) or `'neural'` (default: the scattered light of the scene light slots from our small trained network, K6.N,\n * in `'frame'` lighting, diffusion elsewhere). `'neural'` and `'mlp'` (the same evaluator by its own name) are\n * EXPERIMENTAL: they run the generic small-MLP evaluator on `renderer.mlp` (null: 1D diffusion), whose data shape may\n * change before 1.0.\n */\n multipleScattering: VDBFrameMultipleScatteringMode;\n /** `'octaves'`: octaves N (1–8, default 4). Octave n has extinction × aⁿ, light × bⁿ, phase g × cⁿ. */\n scatteringOctaves: number;\n /** `'octaves'`: a (0–1, default 0.5). */\n scatteringOctaveExtinction: number;\n /** `'octaves'`: b (0–1, default 0.5). */\n scatteringOctaveContribution: number;\n /** `'octaves'`: c (0–1, default 0.5). */\n scatteringOctavePhase: number;\n /**\n * Spectral media (his `spectral`, default false): per-channel extinction (each volume's `extinctionScale` ×\n * (λ / 550)^−`angstromExponent`), per-channel albedo and multiple scattering. 'frame' lighting draws one\n * transmittance pass per slot group; the froxels get a second texture. K7.4a: `'neural'` / `'mlp'` run the network\n * once per channel (his `isNeural` ran them as 1D diffusion; a grey medium renders as with spectral off); K7.4a-3:\n * `'multi-scale'` runs its lookup once per channel too.\n */\n spectral: boolean;\n /**\n * Volumes cast shadows on meshes (his `castShadows`, default false), for directional, point and spot lights that ask\n * for a map: Beer shadow maps from the world shadow grid's last cascade, read by the host's receivers\n * (`vdbVolumeShadowWgsl`; `./three` multiplies them into each light's shadow).\n */\n castShadows: boolean;\n /**\n * Texels on each side of a volume shadow map (each cascade tile and cube face; default 512). Clamped (warned once)\n * to `maxTextureDimension2D` and to a map whose zero-fill staging fits `maxBufferSize` (a point light's 6 faces\n * count; K6.10a).\n */\n castShadowMapSize: number;\n /** Directional lights: cascades of the volume shadow map (1–4, default 1). */\n castShadowCascades: number;\n /** Directional lights: the largest view distance the cascades cover (default 4000). */\n castShadowDistance: number;\n /** Grid samples on each light ray of a volume shadow map (1–256, default 32). */\n castShadowSteps: number;\n /** Map pieces drawn again in one update (a cascade tile or spot map 1, a cube map 6; default 1). */\n castShadowUpdatesPerFrame: number;\n /** Very small maps (64) and few samples (8): soft blob shadows at almost no cost (default false). */\n castShadowCoarse: boolean;\n /** K6.3 `'multi-scale'`: levels read, base included (2–8; his `multiScaleLevels`, default 6). */\n multiScaleLevels: number;\n /**\n * K6.5b: the host's depth shadow maps (`VDBFrameInput.occluders`) shadow the volumes (mesh → volume shadows: the\n * 'frame' transmittance and gather, the 'volume' march). Default true; it does nothing without maps.\n */\n occlusion: boolean;\n /**\n * K6.Q1 (V85): shadowed ambient. Ambient, hemisphere and light-probe light (and 'frame' lighting's 'outward'\n * environment) is attenuated by the medium: transmittance marched along `ambientOcclusionPairs` opposite direction\n * pairs, averaged per hemisphere around the sky direction, each the lighting mode's isotropic-light total (white\n * furnace with multiple scattering). 'frame' lighting marches them in the transmittance pass (a grid lookup in the\n * gather); 'volume' lighting per froxel through the volume's shadow march. Default true (D35): the unshadowed light\n * of his renderer was +35 to +148 % too bright in single scattering (the K6.R reference). `false` gives his unshadowed\n * ambient, hemisphere and probe light.\n */\n ambientOcclusion: boolean;\n /** K6.Q1: direction pairs of the shadowed ambient (1–8; 1: ± the sky direction only). */\n ambientOcclusionPairs: number;\n /** K6.Q1: march steps of each 'volume'-lighting ambient direction (0: the volume's `shadowSteps`). */\n ambientOcclusionSteps: number;\n}\n\n/**\n * K6.8: the settings the renderer also reads that are not public in 0.2.0 (A/B settings of 'multi-scale'; K6.3a\n * recommends dropping multi-scale as a default candidate, the owner decides). The renderer's settings object has them\n * (`vdbFrameDefaultSettings()` makes them); set them through this type (`core/internal.ts`).\n */\nexport interface VDBFrameInternalSettings extends VDBFrameSettings {\n /**\n * K6.3 `'multi-scale'`: the mip edge rule (V75): `'zero'` (default; density outside the grid is 0) or his\n * `'clamp'` (clamp-to-edge). An A/B setting for K6.R1.\n */\n multiScaleEdge: \"zero\" | \"clamp\";\n /**\n * K6.3a `'multi-scale'`: the blur of each level (V75 item 5). `'his'` (default; his 4e2d46f): level k reads the\n * binomial mip k, σ ≈ 2^(k−1) voxels. `'paper'`: level k reads mip k + 1, σ ≈ 2^k voxels (Disney \"Deep Scattering\"\n * §4.2: the Gaussian width equals the level's stencil spacing); the chain holds one more mip. An A/B setting.\n */\n multiScaleSigma: \"his\" | \"paper\";\n /**\n * K6.Q1b: the cell rule of the size-adaptive shadow grid (`shadowResolutionMax`): `'both'` (default: the finer of the\n * two), `'optical'` (2 optical depths per cell at the mean density) or `'voxels'` (16 source voxels per cell). An A/B\n * setting.\n */\n shadowResolutionRule: \"both\" | \"optical\" | \"voxels\";\n /**\n * K6.Q1c / K6.Q1d / K6.Q1d-a (V128, D41): the phase weight of the shadowed distant light (ambient, hemisphere, probe;\n * 'frame' lighting's 'outward' environment) with `ambientOcclusion`, both lightings. `'dipole'` (default): a dipole\n * fit to the pair totals, T(ω) ≈ a + b·ω, weighted by each phase lobe's mean cosine g: every distant term ×\n * Σ_lobes w_i clamp(a + g_i b·r, 0, 1) / a (r the view ray), except on diffusion totals (any multiple scattering but\n * `'octaves'`: isotropic, the white furnace holds). `'isotropic'` (K6.Q1): the solid-angle mean of the pair totals.\n * 'volume' lighting fits the dipole per froxel in the gather. 'frame' lighting stores b per shadow-grid voxel in the\n * transmittance stack (one more rgba16float target per cascade, +8 B per voxel; spectral: 3 targets, +24 B), only\n * while something reads it (`vdbFrameDipoleTargetsWanted`: distant light, `ambientOcclusion`, multiple scattering\n * off or `'octaves'`); b is view-independent (no redraw on camera moves). Internal: the public switch is\n * `ambientOcclusion` (K6-Q1d-a handoff).\n */\n ambientPhase: \"isotropic\" | \"dipole\";\n /**\n * K6.Na: the evaluator of `'neural'` / `'mlp'` (EXPERIMENTAL). `'generic'` (default, K6.3): scalar loops over a flat\n * weight array. `'packed'`: the layer layout of the pmndrs neural tooling (pmndrs/denoiser `denoiser-wgsl`: mat4x4 per\n * output group and input chunk, `mat4x4f * vec4f`, vec4 activations), the same network to f32 rounding. An A/B setting\n * (K6-Na handoff); DECISIONS changes only after the A/B.\n */\n mlpRuntime: \"generic\" | \"packed\";\n /**\n * K6.Nb: the feature reaches of `'neural'` / `'mlp'` (EXPERIMENTAL). `'grid'` (K6.N, his): h 2^k with h the last shadow\n * grid cascade's voxel, so the network's inputs move with the grid side (`shadowResolution`, `shadowResolutionMax`).\n * `'world'` (default since K6.Nb): the voxel the last cascade would have at side 64 (the networks' training side), read\n * at the mip level of the same reach (`tools/frame/mlp.ts` `vdbFrameMlpReach`): the inputs stay put across sides, and at\n * side 64 the two are the same numbers. The K6.Nb reference A/B (16 groups): mean |bias| 10.9 % against 11.5 % at the\n * adaptive side, 11.1 % against 11.9 % at side 128, identical at 64 (K6-Nb handoff).\n */\n mlpReach: \"grid\" | \"world\";\n /**\n * K7.4d-a (issue #66): the boxes of the `'neural'` / `'mlp'` feature levels (EXPERIMENTAL). `'voxel'` (default, K6.3,\n * his): level k is a box of 2^k VOXELS per axis, while its input is log(1 + σ h 2^k) with h the largest voxel side, so\n * on a last cascade with non-cubic voxels (each axis snaps to its own power of two) the box is narrower than its input\n * says. `'cubic'`: the chain starts with an anisotropic step (2^e voxels per axis, `tools/frame/mlp.ts`\n * `vdbFrameMlpCubicReduce`), so every level is a cube of side h 2^k; level 0 is read from the chain too. With cubic\n * voxels the two are the same chain. An A/B setting (K7-4d-a handoff); DECISIONS changes only after the A/B.\n */\n mlpFeatures: \"voxel\" | \"cubic\";\n /**\n * Issue #2 step 2: how the slice march (both lightings) reads the density. `'trilinear'` (default): the source's\n * filter. `'stochastic'` (Pharr et al. 2024): at lod 0 one voxel of the trilinear cell, picked with its weight from\n * three uniforms per sub-step (`vdbFrameRand3`: the froxel, the volume and step, the frame id), so a sparse source\n * reads one voxel instead of eight; temporal accumulation averages the picks. exp(−Σσ dt) is not linear in σ, so\n * the mean transmittance is biased upward (Jensen; V182): measure before a default. An A/B setting (K6.S2).\n */\n densityFilter: \"trilinear\" | \"stochastic\";\n /**\n * K7.4c (V229): the exit of a scene light's scattered part (total − direct of any multiple-scattering mode but octaves,\n * whose octaves are phased already), both lightings. `'isotropic'` (default): his isotropic exit. `'dipole'` / `'hg'`:\n * the scattered radiance's mean cosine along the light's travel, μ = (D^{1 − α ḡ} − D) / S clamped to [0, ḡ] (D the\n * direct transmittance, S the scattered total, α the albedo, ḡ the phase's mean cosine: small-angle transport with\n * Poisson scattering orders), weights the scattered part by mix_i max(1 + 3 g_i μ cos θ, 0) (`'dipole'`, the K6.Q1c form)\n * or mix_i HG(g_i μ, cos θ) (`'hg'`, the HG convolution). An A/B setting (K7-4bc handoff, `tools/frame/ms-exit.ts`).\n * K7.4a-2 `'hg-chroma'`: the `'hg'` factor of each channel over the green channel's, so only the chromatic part of the\n * exit acts (media whose g differs per channel: `phaseGExponent`); green and grey media exit as `'isotropic'`.\n */\n msExit: \"isotropic\" | \"dipole\" | \"hg\" | \"hg-chroma\";\n}\n\n/** His v0.26 defaults (`FrameRenderer.js` L191–246, as `VDBFrameRenderer.settings`), plus `occlusion: true` and the K6.Q1 ambient occlusion (on since D35). */\nexport function vdbFrameDefaultSettings(): VDBFrameSettings {\n return vdbFrameDefaultInternalSettings();\n}\n\n/** The defaults with the internal fields typed ({@link VDBFrameInternalSettings}). */\nexport function vdbFrameDefaultInternalSettings(): VDBFrameInternalSettings {\n return {\n width: 512,\n height: 512,\n pixelsPerFroxel: 0,\n depth: 24,\n subSteps: 32,\n near: 0.1,\n far: Infinity,\n fadeRadius: Infinity,\n jitter: false,\n temporal: true,\n temporalBlend: 0.2,\n lighting: \"frame\",\n shadowResolution: 64,\n shadowResolutionMax: 0,\n shadowCascades: 1,\n shadowDistance: 512,\n phase: \"dual-lobe\",\n phaseG: 0.8,\n phaseBackG: -0.3,\n phaseBackWeight: 0.2,\n phaseGExponent: 0.0,\n srgbBlending: true,\n environmentLighting: \"directional\",\n environmentSamples: 8,\n environmentShOrder: 1,\n multipleScattering: \"neural\",\n scatteringOctaves: 4,\n scatteringOctaveExtinction: 0.5,\n scatteringOctaveContribution: 0.5,\n scatteringOctavePhase: 0.5,\n spectral: false,\n castShadows: false,\n castShadowMapSize: 512,\n castShadowCascades: 1,\n castShadowDistance: 4000,\n castShadowSteps: 32,\n castShadowUpdatesPerFrame: 1,\n castShadowCoarse: false,\n multiScaleLevels: 6,\n multiScaleEdge: \"zero\",\n multiScaleSigma: \"his\",\n shadowResolutionRule: \"both\",\n ambientPhase: \"dipole\",\n mlpRuntime: \"generic\",\n mlpReach: \"world\",\n mlpFeatures: \"voxel\",\n densityFilter: \"trilinear\",\n msExit: \"isotropic\",\n occlusion: true,\n ambientOcclusion: true,\n ambientOcclusionPairs: 4,\n ambientOcclusionSteps: 0,\n };\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { VDBCachedPipeline } from "./pipelines.js";
|
|
2
|
+
import { type VDBRetireQueue } from "./resources.js";
|
|
3
|
+
import type { VDBFrameLight, VDBVolumeShadowMap } from "./types.js";
|
|
4
|
+
type V3 = [number, number, number];
|
|
5
|
+
/** What `update` needs from the renderer. */
|
|
6
|
+
export interface VDBFrameShadowInputs {
|
|
7
|
+
readonly lights: readonly VDBFrameLight[];
|
|
8
|
+
readonly castShadows: boolean;
|
|
9
|
+
readonly coarse: boolean;
|
|
10
|
+
readonly steps: number;
|
|
11
|
+
readonly budget: number;
|
|
12
|
+
readonly cascades: number;
|
|
13
|
+
readonly castShadowDistance: number;
|
|
14
|
+
/** The frame camera: world → view, view → world, clip → view, near, far, orthographic. */
|
|
15
|
+
readonly camera: {
|
|
16
|
+
view: ArrayLike<number>;
|
|
17
|
+
cameraWorld: ArrayLike<number>;
|
|
18
|
+
projectionInverse: ArrayLike<number>;
|
|
19
|
+
near: number;
|
|
20
|
+
far: number;
|
|
21
|
+
orthographic: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** The last shadow grid cascade (what the maps march), or null without casters. */
|
|
24
|
+
readonly grid: {
|
|
25
|
+
min: V3;
|
|
26
|
+
size: V3;
|
|
27
|
+
} | null;
|
|
28
|
+
/** The grid's last-cascade version (his castVersion). */
|
|
29
|
+
readonly castVersion: number;
|
|
30
|
+
/** K6.4: spectral maps (the shadow grid holds extinction rgb; maps get the optical depth rgb layers). */
|
|
31
|
+
readonly spectral?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** The volume shadow maps of one core frame renderer. */
|
|
34
|
+
export declare class VDBFrameShadowMaps {
|
|
35
|
+
#private;
|
|
36
|
+
/** The maps by light id (the renderer's `outputs.volumeShadows`). */
|
|
37
|
+
readonly maps: Map<string | number, VDBVolumeShadowMap>;
|
|
38
|
+
/** Pieces drawn and waiting in the last update. */
|
|
39
|
+
readonly stats: {
|
|
40
|
+
drawn: number;
|
|
41
|
+
waiting: number;
|
|
42
|
+
};
|
|
43
|
+
/** +1 when a map texture is a new object. */
|
|
44
|
+
version: number;
|
|
45
|
+
constructor(device: GPUDevice, label: string, retire: VDBRetireQueue, warn?: (key: string, message: string) => void);
|
|
46
|
+
/** True when some light this frame asks for a map (the renderer then draws the shadow grid). */
|
|
47
|
+
static wanted(lights: readonly VDBFrameLight[], castShadows: boolean): boolean;
|
|
48
|
+
/** The CPU work of one update: entries, cameras, changed pieces within the budget, drawn views. Returns the dispatch count. */
|
|
49
|
+
update(o: VDBFrameShadowInputs): number;
|
|
50
|
+
/** Records the drawn pieces (after the shadow grid in the same pass). */
|
|
51
|
+
record(pass: GPUComputePassEncoder, built: VDBCachedPipeline<GPUComputePipeline>, group0: GPUBindGroup, grid: GPUTexture): void;
|
|
52
|
+
/** Frees every map (renderer dispose). */
|
|
53
|
+
dispose(): void;
|
|
54
|
+
}
|
|
55
|
+
export {};
|