@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
|
@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,KAAkB,EAAE,MAAoB,EAAE,QAAgB,EAAE,KAA0B;QACnH,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAChC,OAAO;QACT,CAAC;QAED,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAED,4FAA4F;IAC5F,OAAO;QACL,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/FrameVolumeShadows.js L34–1027 (targets, the light shadow reset, receiver\n// uniforms, cascade lookup, FrameVolumeShadowNode, FrameVolumeShadows: entries, install, cameras, cascades,\n// the budgeted map updates, dispose).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: TypeScript; every three r187 internal goes through `three-internals.ts`, which self-tests it and throws\n// VDB_ENGINE_MISMATCH (his: a warning, then no volume shadow); the receiver depth and cascade maths have CPU twins\n// (`@pmndrs/vdb/tools` `vdbFrameShadow*`). Divergences: DIVERGES.md (K3.6 rows).\n\n/**\n * K3.6: shadows of `VDBFrameVolume`s on meshes (`frameRenderer.settings.castShadows`, his `FrameVolumeShadows`).\n * Each shadow-casting directional, spot or point light gets a Beer shadow map made from the world shadow grid's\n * last cascade ({@link VDBFrameVolumeShadowMaterial}); the light's `shadow.filterNode` multiplies three's shadow\n * by the volume transmittance at the receiver. Directional lights: cascades of the view (three's CSMShadowNode\n * split), tiles of one atlas. Spot: the light's shadow camera. Point: a cube map. A map piece is drawn again only\n * when its camera or the grid changes, at most `castShadowUpdatesPerFrame` pieces per render (oldest first).\n *\n * three: receivers need `receiveShadow`, the light `castShadow`, and `renderer.shadowMap.enabled`. The maps are\n * drawn before the first receiver of each render (the node's `updateBefore`), so the grid is ready before the\n * volumes draw.\n */\n\nimport * as THREE from \"three\";\nimport { CubeRenderTarget, Node } from \"three/webgpu\";\nimport * as TSL from \"three/tsl\";\nimport type { WebGPURenderer } from \"three/webgpu\";\nimport type { VDBTslNode } from \"../grid-node.js\";\nimport { frameMaxShadowMapCascades, frameShadowCascadeMargin, frameShadowCoarseMapSize, frameShadowCoarseSteps, frameShadowMinOpticalDepth, vdbFrameShadowCascadeBreaks, vdbFrameShadowCascadeFar } from \"../../tools/frame/shadows.js\";\nimport { VDBFrameVolumeShadowMaterial, createShadowRayUniforms, frameMaxCastShadowSteps, frameShadowDepth, type ShadowRayUniforms } from \"./volume-shadow-material.js\";\nimport { vdbFrameCheckFilterInputs, vdbFrameCheckLightReset, vdbFrameRenderUpdateType, vdbFrameShadowFilters, vdbFrameSharedLightNode } from \"./three-internals.js\";\nimport type { VDBFrameRenderer } from \"./renderer.js\";\n\nconst { Fn, If, clamp, cubeTexture, dot, exp, float, int, max, positionView, positionWorld, renderGroup, select, texture, uniform, vec2, vec3, vec4 } = TSL as unknown as Record<string, VDBTslNode>;\n\ntype N = VDBTslNode;\ntype RendererLike = WebGPURenderer & { isWebGPURenderer?: boolean; coordinateSystem: number };\n\nexport { frameMaxShadowMapCascades };\n\nconst clearColor = new THREE.Color();\nconst lightDirection = new THREE.Vector3();\nconst lightUp = new THREE.Vector3();\nconst point = new THREE.Vector3();\nconst lightView = new THREE.Matrix4();\nconst lightViewInverse = new THREE.Matrix4();\nconst casterBox = new THREE.Box3();\nconst casterWorldBox = new THREE.Box3();\nconst sliceBox = new THREE.Box3();\nconst tileViewport = new THREE.Vector4();\nconst nearCorners = [0, 1, 2, 3].map(() => new THREE.Vector3());\nconst farCorners = [0, 1, 2, 3].map(() => new THREE.Vector3());\n\n// NOTE Values for change checks. One array, reused for each check.\nconst signature: number[] = [];\n\n// NOTE Fullscreen triangle. Positions are clip coordinates.\nconst createFullscreenGeometry = () => new THREE.BufferGeometry().setAttribute(\"position\", new THREE.Float32BufferAttribute([-1, -1, 0, 3, -1, 0, -1, 3, 0], 3));\n\nconst targetOptions: THREE.RenderTargetOptions = {\n type: THREE.HalfFloatType,\n format: THREE.RGBAFormat,\n minFilter: THREE.LinearFilter,\n magFilter: THREE.LinearFilter,\n generateMipmaps: false,\n depthBuffer: false,\n};\n\ntype ShadowLight = THREE.DirectionalLight | THREE.SpotLight | THREE.PointLight;\n\n// NOTE Directional lights: an atlas with one tile for each cascade, in a row\nconst createTarget = (size: number, light: ShadowLight): THREE.RenderTarget => {\n if ((light as THREE.PointLight).isPointLight) {\n return new CubeRenderTarget(size, targetOptions) as unknown as THREE.RenderTarget;\n }\n\n const tiles = (light as THREE.DirectionalLight).isDirectionalLight ? frameMaxShadowMapCascades : 1;\n\n return new THREE.RenderTarget(size * tiles, size, targetOptions);\n};\n\n// NOTE Clears a new map one time. Then three makes its GPU texture as a render target texture now.\n// Else the first render makes a new GPU texture, and receivers that sampled the map before keep the destroyed one.\nconst initTarget = (renderer: RendererLike, target: THREE.RenderTarget, cube: boolean): THREE.RenderTarget => {\n const currentRenderTarget = renderer.getRenderTarget();\n const currentActiveCubeFace = renderer.getActiveCubeFace();\n const currentActiveMipmapLevel = renderer.getActiveMipmapLevel();\n const currentClearAlpha = renderer.getClearAlpha();\n\n renderer.getClearColor(clearColor);\n renderer.setClearColor(0x000000, 0.0);\n\n for (let face = 0; face < (cube ? 6 : 1); face++) {\n renderer.setRenderTarget(target, face);\n renderer.clear(true, false, false);\n }\n\n renderer.setClearColor(clearColor, currentClearAlpha);\n renderer.setRenderTarget(currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel);\n\n return target;\n};\n\nconst isShadowLight = (light: THREE.Object3D): light is ShadowLight => {\n const l = light as THREE.Light & { isDirectionalLight?: boolean; isSpotLight?: boolean; isPointLight?: boolean };\n\n return !!(l.isDirectionalLight || l.isSpotLight || l.isPointLight) && l.castShadow;\n};\n\n// NOTE Corners of the view between two depths, in world space. Corners 0 and 2 are diagonal.\nconst getSliceCorners = (camera: THREE.Camera, near: number, far: number): void => {\n const corners = [\n [-1, -1],\n [1, -1],\n [1, 1],\n [-1, 1],\n ] as const;\n const perspective = (camera as THREE.PerspectiveCamera).isPerspectiveCamera;\n\n corners.forEach(([x, y], index) => {\n for (const [target, depth] of [\n [nearCorners[index]!, near],\n [farCorners[index]!, far],\n ] as const) {\n // NOTE A point on the corner ray, then moved to the depth (perspective) or set to it (orthographic)\n target.set(x, y, 0.5).applyMatrix4(camera.projectionMatrixInverse);\n\n if (perspective) {\n target.multiplyScalar(depth / -target.z);\n } else {\n target.z = -depth;\n }\n\n target.applyMatrix4(camera.matrixWorld);\n }\n });\n};\n\n// NOTE A light shadow node is built one time; a new filterNode has no effect until it is built again.\n// disposeShadow of the shared light node makes the receivers build a new shadow node (three-internals.ts, internal 1).\n// Returns the old shadow node, or null when there is none. Receivers can use it until the end of this render.\nconst resetLightShadow = (light: ShadowLight): { dispose(): void } | null => {\n vdbFrameCheckLightReset();\n\n const lightNode = vdbFrameSharedLightNode(light) as { shadowNode: { dispose(): void } | null; disposeShadow(): void } | null;\n\n if (!lightNode || !lightNode.shadowNode) {\n return null;\n }\n\n const { shadowNode } = lightNode;\n\n // NOTE disposeShadow without the GPU dispose\n lightNode.shadowNode = { dispose() {} };\n lightNode.disposeShadow();\n\n return shadowNode;\n};\n\n// NOTE A uniform that copies a value of the entry one time in each render (the render group).\n// A light shadow node is built one time; its object-group uniforms would keep the value of the first build.\nconst renderUniform = (value: unknown, type: string, read: () => unknown): N => uniform(value, type).setGroup(renderGroup).onRenderUpdate(read);\n\ninterface Cascade {\n camera: THREE.OrthographicCamera;\n viewProjection: THREE.Matrix4;\n origin: THREE.Vector3;\n far: number;\n signature: number[];\n lastDraw: number;\n drawn: { viewProjection: THREE.Matrix4; origin: THREE.Vector3; far: number };\n}\n\ninterface Receiver {\n enabled: N;\n rayUniforms: ShadowRayUniforms;\n cascades: { count: N; breaks: N; items: { viewProjection: N; origin: N; far: N }[] } | null;\n}\n\n/** One shadow light's maps and state. */\nexport interface VDBFrameShadowEntry {\n light: ShadowLight;\n isPoint: boolean;\n target: THREE.RenderTarget;\n size: number;\n spectral: boolean;\n spectralTarget: THREE.RenderTarget | null;\n spectralMap: N | null;\n renderId: number;\n cubeCamera: THREE.CubeCamera | null;\n map: N;\n enabled: N;\n rayUniforms: ShadowRayUniforms;\n drawn: { origin: THREE.Vector3; forward: THREE.Vector3; perspective: number; far: number; cascadeCount: number; cascadeBreaks: THREE.Vector4 };\n item: { signature: number[]; lastDraw: number };\n cascadeCount: number;\n cascadeBreaks: THREE.Vector4;\n cascades: Cascade[] | null;\n receiver: Receiver;\n userFilter: ((inputs: unknown) => N) | null;\n}\n\n// NOTE Receivers read the drawn state: the values of the camera that drew each map or cascade tile.\n// A map that waits for the frame budget is older, but its values match, so its shadow stays in place.\nconst createReceiverUniforms = (entry: VDBFrameShadowEntry): Receiver => {\n const { drawn, cascades } = entry;\n\n return {\n enabled: renderUniform(0, \"int\", () => entry.enabled.value),\n rayUniforms: {\n frameShadowOrigin: renderUniform(new THREE.Vector3(), \"vec3\", () => drawn.origin),\n frameShadowForward: renderUniform(new THREE.Vector3(), \"vec3\", () => drawn.forward),\n frameShadowPerspective: renderUniform(0, \"int\", () => drawn.perspective),\n frameShadowFar: renderUniform(1.0, \"float\", () => drawn.far),\n },\n cascades: cascades\n ? {\n count: renderUniform(0, \"int\", () => drawn.cascadeCount),\n breaks: renderUniform(new THREE.Vector4(), \"vec4\", () => drawn.cascadeBreaks),\n items: cascades.map((cascade) => ({\n viewProjection: renderUniform(new THREE.Matrix4(), \"mat4\", () => cascade.drawn.viewProjection),\n origin: renderUniform(new THREE.Vector3(), \"vec3\", () => cascade.drawn.origin),\n far: renderUniform(1.0, \"float\", () => cascade.drawn.far),\n })),\n }\n : null,\n };\n};\n\n// NOTE Picks the cascade of the receiver by its view depth, as three's CSMShadowNode (twin: vdbFrameShadowCascadeIndex / Uv).\n// Returns the atlas uv, the ray uniforms of the cascade, and whether the receiver is in a cascade.\nconst getCascadeLookup = (receiver: Receiver, size: number): { uv: N; inside: N; rayUniforms: ShadowRayUniforms } => {\n const { count, breaks, items } = receiver.cascades!;\n const { frameShadowForward } = receiver.rayUniforms;\n const depth = positionView.z.negate();\n const breakList = [breaks.x, breaks.y, breaks.z, breaks.w];\n\n // NOTE Cascade index: the number of cascade far distances in front of the receiver\n let index: N = int(0);\n\n for (let i = 0; i < frameMaxShadowMapCascades - 1; i++) {\n index = index.add(select(depth.greaterThan(breakList[i]).and(int(i + 1).lessThan(count)), int(1), int(0)));\n }\n\n const pick = (key: \"viewProjection\" | \"origin\" | \"far\"): N => items.reduce<N>((result, item, i) => (i === 0 ? item[key] : select(index.equal(i), item[key], result)), null);\n\n const viewProjection = pick(\"viewProjection\");\n const clip = viewProjection.mul(vec4(positionWorld, 1.0));\n const tileUv = vec2(clip.x.mul(0.5).add(0.5), float(0.5).sub(clip.y.mul(0.5)));\n const lastBreak = breakList.reduce<N>((result, value, i) => (i === 0 ? value : select(count.equal(i + 1), value, result)), null);\n\n // NOTE Half a texel in from the tile sides. Then the linear filter does not read the next tile.\n const inset = float(0.5 / size);\n const clampedUv = clamp(tileUv, vec2(inset), vec2(float(1.0).sub(inset)));\n\n return {\n uv: vec2(clampedUv.x.add(float(index)).div(frameMaxShadowMapCascades), clampedUv.y),\n inside: depth.lessThanEqual(lastBreak).and(tileUv.x.greaterThanEqual(0.0)).and(tileUv.x.lessThanEqual(1.0)).and(tileUv.y.greaterThanEqual(0.0)).and(tileUv.y.lessThanEqual(1.0)),\n rayUniforms: {\n frameShadowOrigin: pick(\"origin\"),\n frameShadowForward,\n frameShadowPerspective: int(0),\n frameShadowFar: pick(\"far\"),\n },\n };\n};\n\n/**\n * Volume transmittance at a receiver from the Beer shadow map of the light (part of the light's shadow filter).\n * `uv` is the shadow map uv (spot) or the direction from the light (point); directional lights pick a cascade.\n * `updateBefore` draws the maps before the first receiver of each render. Twin: `vdbFrameShadowReceiver`.\n */\nexport class VDBFrameVolumeShadowNode extends Node {\n static get type(): string {\n return \"VDBFrameVolumeShadowNode\";\n }\n\n readonly shadows: VDBFrameVolumeShadows;\n readonly entry: VDBFrameShadowEntry;\n readonly uv: N;\n\n constructor(shadows: VDBFrameVolumeShadows, entry: VDBFrameShadowEntry, uv: N) {\n super(\"float\");\n\n this.shadows = shadows;\n this.entry = entry;\n this.uv = uv;\n (this as unknown as { updateBeforeType: string }).updateBeforeType = vdbFrameRenderUpdateType();\n }\n\n // NOTE Spectral maps: transmittance of each channel. ShadowMaterial has one shadow mask, so it gets the mean.\n isSpectral(builder: { material?: { isShadowNodeMaterial?: boolean } }): boolean {\n return this.entry.spectralMap !== null && builder.material?.isShadowNodeMaterial !== true;\n }\n\n override getNodeType(builder: never): string {\n return this.isSpectral(builder) ? \"vec3\" : \"float\";\n }\n\n override updateBefore(frame: never): boolean | undefined {\n const { renderer, scene, camera, renderId } = frame as { renderer: RendererLike; scene: THREE.Scene; camera: THREE.Camera; renderId: number };\n\n this.shadows.render(renderer, scene, camera, renderId, this.entry);\n\n return undefined;\n }\n\n override setup(builder: never): N {\n const { entry } = this;\n const { map, spectralMap, isPoint, receiver } = entry;\n const spectral = this.isSpectral(builder);\n let { uv } = this;\n let { rayUniforms } = receiver;\n let inside: N = receiver.enabled.equal(1);\n\n if (receiver.cascades) {\n const lookup = getCascadeLookup(receiver, entry.size);\n\n uv = lookup.uv;\n rayUniforms = lookup.rayUniforms;\n inside = inside.and(lookup.inside);\n } else if (!isPoint) {\n inside = inside.and(uv.x.greaterThanEqual(0.0)).and(uv.x.lessThanEqual(1.0)).and(uv.y.greaterThanEqual(0.0)).and(uv.y.lessThanEqual(1.0));\n }\n\n return Fn(() => {\n const result = (spectral ? vec3(1.0) : float(1.0)).toVar();\n\n If(inside, () => {\n const texel = map.sample(uv).level(0).toVar();\n const opticalDepth = texel.w;\n\n If(opticalDepth.greaterThan(frameShadowMinOpticalDepth), () => {\n const far = rayUniforms.frameShadowFar;\n const first = texel.x.div(opticalDepth).mul(far);\n const last = texel.y.div(opticalDepth).mul(far);\n const depth = frameShadowDepth(rayUniforms, positionWorld);\n\n // NOTE Beer shadow map: optical depth grows linearly from the first to the last density\n const along = clamp(depth.sub(first).div(max(last.sub(first), 1e-4)), 0.0, 1.0);\n\n if (spectral) {\n result.assign(exp(spectralMap.sample(uv).level(0).rgb.mul(along).negate()));\n } else if (spectralMap) {\n // NOTE ShadowMaterial with spectral maps: mean transmittance of the channels\n result.assign(dot(exp(spectralMap.sample(uv).level(0).rgb.mul(along).negate()), vec3(1.0 / 3.0)));\n } else {\n result.assign(exp(opticalDepth.mul(along).negate()));\n }\n });\n });\n\n return result;\n })();\n }\n}\n\n// NOTE An object and all its parents are visible\nconst isVisible = (object: THREE.Object3D): boolean => {\n for (let current: THREE.Object3D | null = object; current; current = current.parent) {\n if (!current.visible) {\n return false;\n }\n }\n\n return true;\n};\n\n// NOTE The object is in a scene. A removed light is not.\nconst isInScene = (object: THREE.Object3D): boolean => {\n let root = object;\n\n while (root.parent) {\n root = root.parent;\n }\n\n return (root as THREE.Scene).isScene === true;\n};\n\n// NOTE Compares the signature with the one of the item. Stores it when it is different.\nconst changed = (item: { signature: number[] }): boolean => {\n const same = signature.length === item.signature.length && signature.every((value, i) => value === item.signature[i]);\n\n if (!same) {\n item.signature.length = 0;\n item.signature.push(...signature);\n }\n\n return !same;\n};\n\ninterface WorkPiece {\n item: { signature: number[]; lastDraw: number };\n cost: number;\n draw(): void;\n}\n\n/** Shadow filter marker (his `isFrameVolumeShadowFilter`). */\ntype VolumeFilter = ((inputs: N) => N) & { isVDBFrameVolumeShadowFilter?: true };\n\n/** Shadows of `VDBFrameVolume`s on meshes, owned by a {@link VDBFrameRenderer} (`frameRenderer.volumeShadows`). */\nexport class VDBFrameVolumeShadows {\n readonly entries = new Map<THREE.Light, VDBFrameShadowEntry>();\n readonly scene = new THREE.Scene();\n readonly rayUniforms = createShadowRayUniforms() as unknown as ShadowRayUniforms;\n readonly material: VDBFrameVolumeShadowMaterial;\n readonly mesh: THREE.Mesh;\n readonly frameRenderer: VDBFrameRenderer;\n // NOTE Replaced and freed maps and shadow nodes. update() runs mid-render, so the next update() disposes them.\n retired: { dispose(): void }[] = [];\n renderCount = 0;\n mapsRenderId = -1;\n mapsCamera: THREE.Camera | null = null;\n /** Map pieces drawn in the last render, and how many waited for the budget (not his; tests and timing). */\n readonly lastUpdate = { drawn: 0, waiting: 0 };\n\n constructor(frameRenderer: VDBFrameRenderer) {\n this.frameRenderer = frameRenderer;\n this.material = new VDBFrameVolumeShadowMaterial(frameRenderer, this.rayUniforms);\n this.mesh = new THREE.Mesh(createFullscreenGeometry(), this.material);\n this.mesh.frustumCulled = false;\n this.scene.matrixWorldAutoUpdate = false;\n this.scene.add(this.mesh);\n }\n\n getMapSize(): number {\n const { settings } = this.frameRenderer;\n\n return settings.castShadowCoarse ? frameShadowCoarseMapSize : Math.max(1, Math.round(settings.castShadowMapSize));\n }\n\n isSpectral(): boolean {\n return this.frameRenderer.settings.spectral === true;\n }\n\n getSteps(): number {\n const { settings } = this.frameRenderer;\n\n return settings.castShadowCoarse ? frameShadowCoarseSteps : THREE.MathUtils.clamp(Math.round(settings.castShadowSteps), 1, frameMaxCastShadowSteps);\n }\n\n getEntry(renderer: RendererLike, light: ShadowLight): VDBFrameShadowEntry {\n let entry = this.entries.get(light);\n\n if (!entry) {\n const isPoint = (light as THREE.PointLight).isPointLight === true;\n const size = this.getMapSize();\n const spectral = this.isSpectral();\n const target = initTarget(renderer, createTarget(size, light), isPoint);\n const spectralTarget = spectral ? initTarget(renderer, createTarget(size, light), isPoint) : null;\n\n entry = {\n light,\n isPoint,\n target,\n size,\n // NOTE settings.spectral: a second map with the optical depth of each channel\n spectral,\n spectralTarget,\n spectralMap: spectralTarget ? (isPoint ? cubeTexture(spectralTarget.texture) : texture(spectralTarget.texture)) : null,\n renderId: -1,\n cubeCamera: isPoint ? new THREE.CubeCamera(0.5, 500.0, target as unknown as THREE.WebGLCubeRenderTarget) : null,\n map: isPoint ? cubeTexture(target.texture) : texture(target.texture),\n enabled: uniform(0, \"int\"),\n // NOTE Current camera values. drawn: the values of the last draw, for the receivers.\n rayUniforms: createShadowRayUniforms() as unknown as ShadowRayUniforms,\n drawn: {\n origin: new THREE.Vector3(),\n forward: new THREE.Vector3(0.0, 0.0, -1.0),\n perspective: 0,\n far: 1.0,\n cascadeCount: 0,\n cascadeBreaks: new THREE.Vector4(),\n },\n // NOTE Spot map or cube map (all faces in one draw), or the split layout of the cascades\n item: { signature: [], lastDraw: -1 },\n cascadeCount: 0,\n cascadeBreaks: new THREE.Vector4(),\n cascades: (light as THREE.DirectionalLight).isDirectionalLight\n ? Array.from({ length: frameMaxShadowMapCascades }, () => ({\n camera: new THREE.OrthographicCamera(),\n viewProjection: new THREE.Matrix4(),\n origin: new THREE.Vector3(),\n far: 1.0,\n signature: [],\n lastDraw: -1,\n drawn: { viewProjection: new THREE.Matrix4(), origin: new THREE.Vector3(), far: 1.0 },\n }))\n : null,\n receiver: null as unknown as Receiver,\n userFilter: null,\n };\n\n entry.receiver = createReceiverUniforms(entry);\n this.entries.set(light, entry);\n }\n\n return entry;\n }\n\n // NOTE A new map for a new size or a spectral change: a new texture, texture node and shadow node (shadow nodes keep texture bindings)\n resizeMap(renderer: RendererLike, entry: VDBFrameShadowEntry, size: number, spectral: boolean): void {\n const oldTargets = entry.spectralTarget ? [entry.target, entry.spectralTarget] : [entry.target];\n\n entry.target = initTarget(renderer, createTarget(size, entry.light), entry.isPoint);\n entry.size = size;\n entry.map = entry.isPoint ? cubeTexture(entry.target.texture) : texture(entry.target.texture);\n entry.spectral = spectral;\n entry.spectralTarget = spectral ? initTarget(renderer, createTarget(size, entry.light), entry.isPoint) : null;\n entry.spectralMap = entry.spectralTarget ? (entry.isPoint ? cubeTexture(entry.spectralTarget.texture) : texture(entry.spectralTarget.texture)) : null;\n\n entry.item.signature.length = 0;\n entry.cascades?.forEach((cascade) => (cascade.signature.length = 0));\n entry.drawn.cascadeCount = 0;\n\n if (entry.cubeCamera) {\n entry.cubeCamera.renderTarget = entry.target as unknown as THREE.WebGLCubeRenderTarget;\n }\n\n this.retire(resetLightShadow(entry.light), oldTargets);\n }\n\n // NOTE Old maps are disposed in the next update()\n retire(oldShadowNode: { dispose(): void } | null, targets: THREE.RenderTarget[]): void {\n this.retired.push(...targets);\n\n if (oldShadowNode) {\n this.retired.push(oldShadowNode);\n }\n }\n\n // NOTE Frees the maps of a light and puts back its own filter. Receivers build again without the volume shadow.\n freeEntry(entry: VDBFrameShadowEntry): void {\n const { light } = entry;\n const targets = entry.spectralTarget ? [entry.target, entry.spectralTarget] : [entry.target];\n const shadow = light.shadow as THREE.LightShadow & { filterNode?: VolumeFilter | null };\n\n // NOTE Receivers that still have the volume shadow node until they build again read no volume shadow\n entry.enabled.value = 0;\n\n if (shadow.filterNode?.isVDBFrameVolumeShadowFilter) {\n shadow.filterNode = entry.userFilter as VolumeFilter | null;\n }\n\n this.retire(resetLightShadow(light), targets);\n this.entries.delete(light);\n }\n\n disposeRetired(): void {\n this.retired.forEach((resource) => resource.dispose());\n this.retired.length = 0;\n }\n\n // NOTE Puts the volume filter on each shadow light. Each frame, then new lights and new filters are found.\n // Frees the entries of lights with no shadow or not in a scene, and all entries when castShadows is off.\n update(renderer: RendererLike, scene: THREE.Object3D): void {\n this.disposeRetired();\n\n if (!this.frameRenderer.settings.castShadows) {\n this.entries.forEach((entry) => this.freeEntry(entry));\n\n return;\n }\n\n // NOTE The light-shadow reset (three internal) is self-tested before the first filter goes on a light\n vdbFrameCheckLightReset();\n\n const size = this.getMapSize();\n const spectral = this.isSpectral();\n\n this.entries.forEach((entry) => {\n if (!isShadowLight(entry.light) || !isInScene(entry.light)) {\n this.freeEntry(entry);\n } else if (entry.size !== size || entry.spectral !== spectral) {\n this.resizeMap(renderer, entry, size, spectral);\n }\n });\n\n scene.traverse((light) => {\n if (isShadowLight(light)) {\n this.install(renderer, light);\n }\n });\n }\n\n install(renderer: RendererLike, light: ShadowLight): void {\n const shadow = light.shadow as THREE.LightShadow & { filterNode?: VolumeFilter | null; map: THREE.RenderTarget | null };\n\n if (shadow.filterNode?.isVDBFrameVolumeShadowFilter) {\n return;\n }\n\n const entry = this.getEntry(renderer, light);\n const userFilter = (shadow.filterNode as VolumeFilter | null | undefined) ?? null;\n const filters = vdbFrameShadowFilters();\n\n entry.userFilter = userFilter;\n\n // NOTE ShadowNode calls the filter when it builds. The base filter is three's or the user's.\n // Point lights give the direction from the light (bd3D), other lights give shadowCoord.\n const filter: VolumeFilter = (inputs) => {\n vdbFrameCheckFilterInputs(inputs, entry.isPoint);\n\n const type = renderer.shadowMap.type as number;\n const baseFilter = (userFilter ?? (entry.isPoint ? (type === THREE.BasicShadowMap ? filters.basicPoint : filters.point) : filters.maps[type])) as ((i: unknown) => N) | null;\n\n if (!baseFilter) {\n throw new Error(\"THREE.WebGPURenderer: Shadow map type not supported yet.\");\n }\n\n // NOTE PointShadowNode calls the filter in a TSL function, and its parameter proxy loses the shadow object.\n // So the base filter gets a plain object with the light shadow.\n const baseInputs: Record<string, unknown> = entry.isPoint\n ? { depthTexture: inputs.depthTexture, bd3D: inputs.bd3D, dp: inputs.dp, distance: inputs.distance }\n : { depthTexture: inputs.depthTexture, shadowCoord: inputs.shadowCoord, depthLayer: inputs.depthLayer };\n\n baseInputs.shadow = shadow;\n\n const uv = entry.isPoint ? inputs.bd3D : (inputs.shadowCoord as N).xy;\n\n return baseFilter(baseInputs).mul(new VDBFrameVolumeShadowNode(this, entry, uv));\n };\n\n filter.isVDBFrameVolumeShadowFilter = true;\n shadow.filterNode = filter;\n\n // NOTE The map exists when the shadow node was built before this filter\n if (shadow.map) {\n this.retire(resetLightShadow(light), []);\n }\n }\n\n // NOTE Spot lights: the light shadow camera. Point lights: a cube camera at the light. Sets the ray uniforms.\n prepareCamera(entry: VDBFrameShadowEntry): THREE.Camera {\n const { light, rayUniforms } = entry;\n const shadowCamera = light.shadow.camera as THREE.PerspectiveCamera;\n\n if (!entry.isPoint) {\n light.shadow.updateMatrices(light);\n\n rayUniforms.frameShadowOrigin.value.setFromMatrixPosition(shadowCamera.matrixWorld);\n shadowCamera.getWorldDirection(rayUniforms.frameShadowForward.value);\n rayUniforms.frameShadowPerspective.value = shadowCamera.isPerspectiveCamera ? 1 : 0;\n rayUniforms.frameShadowFar.value = shadowCamera.far;\n\n return shadowCamera;\n }\n\n const cubeCamera = entry.cubeCamera!;\n const near = shadowCamera.near;\n const far = (light as THREE.PointLight).distance || shadowCamera.far;\n\n for (const camera of cubeCamera.children as THREE.PerspectiveCamera[]) {\n if (camera.near !== near || camera.far !== far) {\n camera.near = near;\n camera.far = far;\n camera.updateProjectionMatrix();\n }\n }\n\n cubeCamera.position.setFromMatrixPosition(light.matrixWorld);\n cubeCamera.updateMatrixWorld();\n\n rayUniforms.frameShadowOrigin.value.copy(cubeCamera.position);\n rayUniforms.frameShadowPerspective.value = 1;\n rayUniforms.frameShadowFar.value = far;\n\n return cubeCamera.children[0] as THREE.Camera;\n }\n\n // NOTE Cascade cameras of a directional light, the method of three's CSMShadowNode: practical split of the view\n // depth, a light-aligned orthographic camera for each slice, size from the slice diagonal, position snapped to\n // texels. The depth range of each camera covers the slice and the volume box (the last grid cascade). Cascades end\n // at the far corner of the volume box plus one box diagonal, up to castShadowDistance, rounded to half octaves.\n fitCascades(entry: VDBFrameShadowEntry, camera: THREE.Camera, renderer: RendererLike): number {\n const { light, size, rayUniforms } = entry;\n const cascades = entry.cascades!;\n const { settings, gridUniforms } = this.frameRenderer;\n const count = THREE.MathUtils.clamp(Math.round(settings.castShadowCascades), 1, frameMaxShadowMapCascades);\n const last = (gridUniforms.frameGridCount.value as number) - 1;\n const cam = camera as THREE.PerspectiveCamera;\n const near = cam.near;\n const gridMin = gridUniforms.frameGridMin.array as THREE.Vector3[];\n const gridSize = gridUniforms.frameGridSize.array as THREE.Vector3[];\n\n casterWorldBox.min.copy(gridMin[last]!);\n casterWorldBox.max.copy(gridMin[last]!).add(gridSize[last]!);\n\n let boxFar = 0.0;\n\n for (let i = 0; i < 8; i++) {\n point\n .set(i & 1 ? casterWorldBox.max.x : casterWorldBox.min.x, i & 2 ? casterWorldBox.max.y : casterWorldBox.min.y, i & 4 ? casterWorldBox.max.z : casterWorldBox.min.z)\n .applyMatrix4(camera.matrixWorldInverse);\n\n boxFar = Math.max(boxFar, -point.z);\n }\n\n const far = vdbFrameShadowCascadeFar(near, cam.far, settings.castShadowDistance, boxFar, casterWorldBox.getSize(point).length());\n const breaks = vdbFrameShadowCascadeBreaks(count, near, far);\n\n lightDirection.setFromMatrixPosition((light as THREE.DirectionalLight).target.matrixWorld).sub(point.setFromMatrixPosition(light.matrixWorld)).normalize();\n\n // NOTE Rotation of a camera that looks along the light (Object3D.lookAt of a camera). Up is +z for vertical light.\n lightUp.set(0.0, 1.0, 0.0);\n\n if (Math.abs(lightDirection.y) > 0.999) {\n lightUp.set(0.0, 0.0, 1.0);\n }\n\n lightView.lookAt(point.set(0.0, 0.0, 0.0), lightDirection, lightUp);\n lightViewInverse.copy(lightView).invert();\n\n casterBox.copy(casterWorldBox).applyMatrix4(lightViewInverse);\n\n entry.cascadeCount = count;\n entry.cascadeBreaks.set(breaks[Math.min(0, count - 1)]!, breaks[Math.min(1, count - 1)]!, breaks[Math.min(2, count - 1)]!, breaks[Math.min(3, count - 1)]!);\n\n for (let i = 0; i < count; i++) {\n const cascade = cascades[i]!;\n const cascadeCamera = cascade.camera;\n\n getSliceCorners(camera, i === 0 ? near : breaks[i - 1]!, breaks[i]!);\n\n const width = Math.max(farCorners[0]!.distanceTo(farCorners[2]!), farCorners[0]!.distanceTo(nearCorners[2]!));\n const texel = width / size;\n\n sliceBox.makeEmpty();\n for (const corner of [...nearCorners, ...farCorners]) {\n sliceBox.expandByPoint(point.copy(corner).applyMatrix4(lightViewInverse));\n }\n\n const centerX = Math.floor(((sliceBox.min.x + sliceBox.max.x) * 0.5) / texel) * texel;\n const centerY = Math.floor(((sliceBox.min.y + sliceBox.max.y) * 0.5) / texel) * texel;\n const front = Math.max(sliceBox.max.z, casterBox.max.z) + frameShadowCascadeMargin;\n const back = Math.min(sliceBox.min.z, casterBox.min.z) - frameShadowCascadeMargin;\n\n cascadeCamera.left = -width * 0.5;\n cascadeCamera.right = width * 0.5;\n cascadeCamera.top = width * 0.5;\n cascadeCamera.bottom = -width * 0.5;\n cascadeCamera.near = 0.0;\n cascadeCamera.far = front - back;\n cascadeCamera.coordinateSystem = renderer.coordinateSystem as THREE.CoordinateSystem;\n cascadeCamera.updateProjectionMatrix();\n\n // NOTE Light view looks along -z, so the camera is at the front (largest z)\n cascadeCamera.position.set(centerX, centerY, front).applyMatrix4(lightView);\n cascadeCamera.quaternion.setFromRotationMatrix(lightView);\n cascadeCamera.updateMatrixWorld();\n\n cascade.viewProjection.multiplyMatrices(cascadeCamera.projectionMatrix, cascadeCamera.matrixWorldInverse);\n cascade.origin.copy(cascadeCamera.position);\n cascade.far = cascadeCamera.far;\n }\n\n cascades[0]!.camera.getWorldDirection(rayUniforms.frameShadowForward.value);\n rayUniforms.frameShadowPerspective.value = 0;\n\n return count;\n }\n\n // NOTE Copies ray values to the uniforms of the pass material\n setPassRay(origin: THREE.Vector3, forward: THREE.Vector3, perspective: number, far: number): void {\n this.rayUniforms.frameShadowOrigin.value.copy(origin);\n this.rayUniforms.frameShadowForward.value.copy(forward);\n this.rayUniforms.frameShadowPerspective.value = perspective;\n this.rayUniforms.frameShadowFar.value = far;\n }\n\n // NOTE Draws the pass into the map of the entry: one tile of it (viewport), or all cube faces (point lights)\n drawPass(renderer: RendererLike, entry: VDBFrameShadowEntry, camera: THREE.Camera, viewport: THREE.Vector4): void {\n const currentRenderTarget = renderer.getRenderTarget();\n const currentActiveCubeFace = renderer.getActiveCubeFace();\n const currentActiveMipmapLevel = renderer.getActiveMipmapLevel();\n const currentAutoClear = renderer.autoClear;\n const currentClearAlpha = renderer.getClearAlpha();\n const currentScissorTest = renderer.getScissorTest();\n\n renderer.getClearColor(clearColor);\n renderer.autoClear = false;\n renderer.setScissorTest(false);\n this.mesh.layers.mask = camera.layers.mask;\n\n // NOTE Spectral: the second draw writes the optical depth of each channel into the second map\n const targets = entry.spectralTarget ? [entry.target, entry.spectralTarget] : [entry.target];\n\n targets.forEach((target, output) => {\n this.material.frameShadowOutput.value = output;\n\n if (entry.isPoint) {\n const cubeCamera = entry.cubeCamera!;\n\n cubeCamera.renderTarget = target as unknown as THREE.WebGLCubeRenderTarget;\n cubeCamera.update(renderer as never, this.scene);\n } else {\n target.viewport.copy(viewport);\n renderer.setRenderTarget(target);\n renderer.render(this.scene, camera);\n }\n });\n\n if (entry.isPoint) {\n entry.cubeCamera!.renderTarget = entry.target as unknown as THREE.WebGLCubeRenderTarget;\n }\n\n renderer.setScissorTest(currentScissorTest);\n renderer.autoClear = currentAutoClear;\n renderer.setClearColor(clearColor, currentClearAlpha);\n renderer.setRenderTarget(currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel);\n }\n\n // NOTE Adds the changed map pieces of one light to the work list\n collectWork(entry: VDBFrameShadowEntry, camera: THREE.Camera, renderer: RendererLike, work: WorkPiece[]): void {\n const castVersion = this.frameRenderer.gridState.castVersion;\n const steps = this.getSteps();\n const { drawn, rayUniforms } = entry;\n\n if (entry.cascades) {\n const cascades = entry.cascades;\n const count = this.fitCascades(entry, camera, renderer);\n const forward = rayUniforms.frameShadowForward.value as THREE.Vector3;\n\n const drawCascade = (i: number) => {\n const cascade = cascades[i]!;\n\n this.setPassRay(cascade.origin, forward, 0, cascade.far);\n this.drawPass(renderer, entry, cascade.camera, tileViewport.set(i * entry.size, 0, entry.size, entry.size));\n cascade.drawn.viewProjection.copy(cascade.viewProjection);\n cascade.drawn.origin.copy(cascade.origin);\n cascade.drawn.far = cascade.far;\n cascade.lastDraw = this.renderCount;\n drawn.forward.copy(forward);\n };\n\n const cascadeChanged = (i: number) => {\n const cascade = cascades[i]!;\n\n signature.length = 0;\n signature.push(entry.size, castVersion, steps, ...cascade.camera.matrixWorld.elements);\n signature.push(...cascade.camera.projectionMatrix.elements);\n\n return changed(cascade);\n };\n\n // NOTE A new split layout: one piece draws all cascades, then the receivers switch to the layout.\n // Receivers never mix tiles of two layouts.\n signature.length = 0;\n signature.push(entry.size, count, ...entry.cascadeBreaks.toArray());\n\n if (changed(entry.item)) {\n for (let i = 0; i < count; i++) {\n cascadeChanged(i);\n }\n\n work.push({\n item: entry.item,\n cost: count,\n draw: () => {\n for (let i = 0; i < count; i++) {\n drawCascade(i);\n }\n\n drawn.cascadeCount = count;\n drawn.cascadeBreaks.copy(entry.cascadeBreaks);\n },\n });\n\n return;\n }\n\n for (let i = 0; i < count; i++) {\n if (cascadeChanged(i)) {\n work.push({ item: cascades[i]!, cost: 1, draw: () => drawCascade(i) });\n }\n }\n\n return;\n }\n\n const shadowCamera = this.prepareCamera(entry);\n\n signature.length = 0;\n signature.push(entry.size, castVersion, steps, ...(entry.isPoint ? entry.cubeCamera! : shadowCamera).matrixWorld.elements);\n signature.push(...(shadowCamera as THREE.PerspectiveCamera).projectionMatrix.elements);\n\n if (!changed(entry.item)) {\n return;\n }\n\n work.push({\n item: entry.item,\n // NOTE All six cube faces in one draw, then the faces always match\n cost: entry.isPoint ? 6 : 1,\n draw: () => {\n this.setPassRay(rayUniforms.frameShadowOrigin.value, rayUniforms.frameShadowForward.value, rayUniforms.frameShadowPerspective.value, rayUniforms.frameShadowFar.value);\n this.drawPass(renderer, entry, shadowCamera, tileViewport.set(0, 0, entry.size, entry.size));\n drawn.origin.copy(rayUniforms.frameShadowOrigin.value);\n drawn.forward.copy(rayUniforms.frameShadowForward.value);\n drawn.perspective = rayUniforms.frameShadowPerspective.value;\n drawn.far = rayUniforms.frameShadowFar.value;\n },\n });\n }\n\n // NOTE Volume shadow maps of all lights, one time in each render, before the first receiver.\n // Changed pieces are drawn oldest first, up to castShadowUpdatesPerFrame (a tile or spot map costs 1, a cube map 6).\n // The oldest piece is always drawn. Then a large piece does not wait forever.\n updateMaps(renderer: RendererLike, scene: THREE.Scene, camera: THREE.Camera, renderId: number): void {\n if (this.mapsRenderId === renderId && this.mapsCamera === camera) {\n return;\n }\n\n this.mapsRenderId = renderId;\n this.mapsCamera = camera;\n this.renderCount++;\n this.lastUpdate.drawn = 0;\n this.lastUpdate.waiting = 0;\n\n const { frameRenderer } = this;\n const ready = frameRenderer.settings.castShadows && !!renderer.isWebGPURenderer && frameRenderer.prepareShadowGrid(renderer, scene, camera, renderId);\n\n if (!ready) {\n this.entries.forEach((entry) => {\n entry.enabled.value = 0;\n entry.item.signature.length = 0;\n entry.cascades?.forEach((cascade) => (cascade.signature.length = 0));\n });\n\n return;\n }\n\n this.material.setSpectral(this.isSpectral());\n this.material.frameShadowDensityMap.value = frameRenderer.shadowDensityTarget!.textures[0];\n this.material.frameShadowSteps.value = this.getSteps();\n\n const work: WorkPiece[] = [];\n\n this.entries.forEach((entry) => {\n const active = entry.light.castShadow && isVisible(entry.light);\n\n entry.enabled.value = active ? 1 : 0;\n\n if (active) {\n this.collectWork(entry, camera, renderer, work);\n }\n });\n\n work.sort((a, b) => a.item.lastDraw - b.item.lastDraw);\n\n let budget = Math.max(1, Math.round(frameRenderer.settings.castShadowUpdatesPerFrame));\n\n frameRenderer.passHook?.begin?.(\"volumeShadows\");\n\n work.forEach((piece, index) => {\n if (index > 0 && piece.cost > budget) {\n // NOTE Not drawn: the next check sees the change again\n piece.item.signature.length = 0;\n this.lastUpdate.waiting++;\n\n return;\n }\n\n piece.draw();\n piece.item.lastDraw = this.renderCount;\n budget -= piece.cost;\n this.lastUpdate.drawn++;\n });\n\n frameRenderer.passHook?.end?.(\"volumeShadows\");\n }\n\n // NOTE Called by the receivers of a light, one time in each render\n render(renderer: RendererLike, scene: THREE.Scene, camera: THREE.Camera, renderId: number, entry: VDBFrameShadowEntry): void {\n if (entry.renderId === renderId) {\n return;\n }\n\n entry.renderId = renderId;\n this.updateMaps(renderer, scene, camera, renderId);\n }\n\n // NOTE Puts back the filter of each light. Then a new VDBFrameVolumeShadows installs again.\n dispose(): void {\n if (this.entries.size > 0) {\n this.entries.forEach((entry) => this.freeEntry(entry));\n }\n\n this.disposeRetired();\n this.material.dispose();\n this.mesh.geometry.dispose();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"volume-shadows.js","sourceRoot":"","sources":["../../../src/three/frame/volume-shadows.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,sHAAsH;AACtH,8BAA8B;AAC9B,4GAA4G;AAC5G,oHAAoH;AACpH,oCAAoC;AACpC,uHAAuH;AACvH,sHAAsH;AACtH,qHAAqH;AACrH,yHAAyH;AAEzH;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAoD,MAAM,cAAc,CAAC;AACtF,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAmB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpK,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,mBAAmB,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AC,SAAS,GAAG,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/FrameVolumeShadows.js L34–1027 (the light shadow reset, FrameVolumeShadowNode, the\n// filter install, dispose).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Past the pin (K7.1): his 62a6e3e (lookups from the drawn state) and c13f2d5 (the budget counts only lights of the\n// rendered scene; the core's maps).\n// Changes: TypeScript; K6.8: the maps are the core's (`VDBVolumeShadowMap`, drawn by its kernels), three only receives\n// them; K6.8a: the receivers call the core's WGSL (`vdbVolumeShadowWgsl`) with the core's view buffer bound through a\n// storage stand-in, instead of a TSL port of the lookup; every three r187 internal goes through `three-internals.ts`\n// or the `VDBGridNode` attribute self-test, which throw VDB_ENGINE_MISMATCH. Divergences: DIVERGES.md (K3.6, K6.5 rows).\n\n/**\n * K3.6 / K6.5: shadows of `VDBFrameVolume`s on meshes (`frameRenderer.settings.castShadows`, his `FrameVolumeShadows`).\n * Each shadow-casting directional, spot or point light gets a Beer shadow map from the core frame renderer (its\n * `outputs.volumeShadows`); the light's `shadow.filterNode` multiplies three's shadow by the volume transmittance at\n * the receiver.\n *\n * K6.8a: the receiver is the core's own WGSL (`vdbVolumeShadow`, `…Rgb`, `…Cube`, `…CubeRgb` of `vdbVolumeShadowWgsl()`)\n * through a `wgslFn`. Its inputs are the map texture (a 2d-array: directional cascades or a spot map; a point map through a\n * cube view), the spectral rgb twin, and the map's `view` buffer, the state the map was drawn with (his 62a6e3e), which\n * the core rewrites each update: three binds that buffer itself through a storage stand-in (the `VDBGridNode` pool-buffer\n * pattern), read as `array<vec4u>` and unpacked into `VdbVolumeShadowView`. Each light's texture and storage nodes are\n * made once and only their `value` follows the core (a new stand-in when the core made a new texture or buffer), so a\n * receiver built at any time binds the core's current objects; while a light has no core map they bind a placeholder\n * (a zero view: transmittance 1), never a texture or buffer the core retired (K6.10 finding 8).\n *\n * three: receivers need `receiveShadow`, the light `castShadow`, and `renderer.shadowMap.enabled`. The core update runs\n * before the first receiver of each render (the node's `updateBefore`), so the maps are this render's.\n */\n\nimport * as THREE from \"three\";\nimport { Node, type StorageBufferAttribute, type WebGPURenderer } from \"three/webgpu\";\nimport * as TSL from \"three/tsl\";\nimport { vdbThreeStorageStandIn, type VDBTslNode } from \"../grid-node.js\";\nimport { getDevice } from \"../device.js\";\nimport { frameShadowCoarseMapSize } from \"../../tools/frame/shadows.js\";\nimport { vdbFrameCheckFilterInputs, vdbFrameCheckLightReset, vdbFrameRenderUpdateType, vdbFrameShadowFilters, vdbFrameSharedLightNode } from \"./three-internals.js\";\nimport type { VDBFrameRenderer } from \"./renderer.js\";\nimport { VDBCoreTextureBinding } from \"./core-textures.js\";\nimport { VDBFrameStructLoaderNode, vdbFrameStructLoaderWgsl, vdbFrameStructWords, type VDBFrameStorageNode } from \"./core-structs.js\";\nimport { VDB_VOLUME_SHADOW_VIEW, vdbVolumeShadowWgsl } from \"../../core/frame/wgsl/shadows.js\";\nimport type { VDBVolumeShadowMap } from \"../../core/frame/types.js\";\n\nconst { code, cubeTexture, dot, positionView, positionWorld, sampler, storage, texture, vec3, wgslFn } = TSL as unknown as Record<string, VDBTslNode>;\n\ntype N = VDBTslNode;\ntype RendererLike = WebGPURenderer & { isWebGPURenderer?: boolean };\ntype ShadowLight = THREE.DirectionalLight | THREE.SpotLight | THREE.PointLight;\ntype StorageNode = VDBFrameStorageNode;\n\nconst isShadowLight = (light: THREE.Object3D): light is ShadowLight => {\n const l = light as THREE.Light & { isDirectionalLight?: boolean; isSpotLight?: boolean; isPointLight?: boolean };\n return !!(l.isDirectionalLight || l.isSpotLight || l.isPointLight) && l.castShadow;\n};\n\n// NOTE The object is in a scene. A removed light is not.\nconst isInScene = (object: THREE.Object3D): boolean => {\n let root = object;\n while (root.parent) root = root.parent;\n return (root as THREE.Scene).isScene === true;\n};\n\n// NOTE A light shadow node is built one time; a new filterNode has no effect until it is built again.\n// disposeShadow of the shared light node makes the receivers build a new shadow node (three-internals.ts, internal 1).\n// Returns the old shadow node, or null when there is none. Receivers can use it until the end of this render.\nconst resetLightShadow = (light: ShadowLight): { dispose(): void } | null => {\n vdbFrameCheckLightReset();\n const lightNode = vdbFrameSharedLightNode(light) as { shadowNode: { dispose(): void } | null; disposeShadow(): void } | null;\n if (!lightNode || !lightNode.shadowNode) return null;\n const { shadowNode } = lightNode;\n // NOTE disposeShadow without the GPU dispose\n lightNode.shadowNode = { dispose() {} };\n lightNode.disposeShadow();\n return shadowNode;\n};\n\n/** `vec4u` words of the view struct (every field is 16-byte aligned). */\nconst VIEW_WORDS = vdbFrameStructWords(VDB_VOLUME_SHADOW_VIEW);\n\n/**\n * WGSL that unpacks the view buffer (bound as `array<vec4u>` at `ref`) into the core's `VdbVolumeShadowView`, generated\n * from the struct's layout, so a field the core adds is unpacked too (a type this cannot unpack throws).\n */\nexport function vdbFrameShadowViewLoaderWgsl(fnName: string, ref: string): string {\n return vdbFrameStructLoaderWgsl(VDB_VOLUME_SHADOW_VIEW, fnName, ref);\n}\n\n/** The core's receiver functions and the view struct, one code node shared by every receiver (once per shader). */\nlet receiverCode: N | null = null;\nconst receiverCodeNode = (): N => (receiverCode ??= code(vdbVolumeShadowWgsl()));\n\n/** The texture and buffer nodes of one light's receivers; made once, their values follow the core. */\ninterface EntryNodes {\n /** Unique per receivers object: names the storage binding and the WGSL functions. */\n k: number;\n map: N;\n rgb: N;\n view: StorageNode;\n loader: VDBFrameStructLoaderNode;\n fns: Map<string, (inputs: Record<string, N>) => N>;\n}\n\n/** What a light without a core map binds: a 1² 2d-array, a 1² cube (6 layers) and a zero view (enabled 0). */\ninterface Placeholders {\n device: GPUDevice;\n array: GPUTexture;\n cube: GPUTexture;\n view: GPUBuffer;\n}\n\n/** One shadow light's core map, as its receivers bind it. */\nexport interface VDBFrameShadowEntry {\n light: ShadowLight;\n isPoint: boolean;\n /** The map's size (texels per side) of the last core map; the settings' size before one. */\n size: number;\n /** The core map the receivers bind now (null: none yet, or the light has none this frame; they bind placeholders). */\n coreMap: VDBVolumeShadowMap | null;\n /** The core update count at the last draw of the map's first piece (his `lastDraw`; tests and the stale harness). */\n lastDraw: number;\n userFilter: ((inputs: unknown) => N) | null;\n /** The map texture bound now (the core's, or the placeholder). */\n texture: GPUTexture | null;\n binding: VDBCoreTextureBinding;\n /** K6.4 spectral: the optical depth rgb twin bound now (null: a grey map; the node binds the placeholder). */\n rgbTexture: GPUTexture | null;\n rgbBinding: VDBCoreTextureBinding;\n /** The view buffer bound now (the core's, or the placeholder). */\n viewBuffer: GPUBuffer | null;\n nodes: EntryNodes | null;\n}\n\n/**\n * Volume transmittance at a receiver from the light's core Beer shadow map: the core's `vdbVolumeShadow` /\n * `vdbVolumeShadowCube` (K6.4 spectral maps: `…Rgb` / `…CubeRgb`, the channel mean in a ShadowMaterial, his rule) through\n * a `wgslFn`, with the view the map was drawn with (twin `vdbFrameVolumeShadowLookup`). `updateBefore` runs the core\n * update before the first receiver of each render.\n */\nexport class VDBFrameVolumeShadowNode extends Node {\n static get type(): string {\n return \"VDBFrameVolumeShadowNode\";\n }\n\n readonly shadows: VDBFrameVolumeShadowReceivers;\n readonly entry: VDBFrameShadowEntry;\n\n constructor(shadows: VDBFrameVolumeShadowReceivers, entry: VDBFrameShadowEntry) {\n super(\"float\");\n this.shadows = shadows;\n this.entry = entry;\n (this as unknown as { updateBeforeType: string }).updateBeforeType = vdbFrameRenderUpdateType();\n }\n\n // NOTE Spectral maps: transmittance of each channel. ShadowMaterial has one shadow mask, so it gets the mean.\n isSpectral(builder: { material?: { isShadowNodeMaterial?: boolean } }): boolean {\n return this.entry.rgbTexture !== null && builder.material?.isShadowNodeMaterial !== true;\n }\n\n override getNodeType(builder: never): string {\n return this.isSpectral(builder) ? \"vec3\" : \"float\";\n }\n\n override updateBefore(frame: never): boolean | undefined {\n const { renderer, scene, camera, renderId } = frame as { renderer: RendererLike; scene: THREE.Scene; camera: THREE.Camera; renderId: number };\n this.shadows.render(renderer, scene, camera, renderId);\n return undefined;\n }\n\n override setup(builder: never): N {\n const { entry } = this;\n const nodes = this.shadows.nodesOf(entry);\n const rgbKind = entry.rgbTexture !== null;\n const fn = this.shadows.receiverFn(entry, rgbKind);\n const inputs: Record<string, N> = { map: nodes.map, smp: sampler(nodes.map), world: positionWorld };\n if (rgbKind) inputs.rgb = nodes.rgb;\n if (!entry.isPoint) inputs.viewDepth = positionView.z.negate();\n const value = fn(inputs);\n // NOTE ShadowMaterial with spectral maps: mean transmittance of the channels\n return rgbKind && !this.isSpectral(builder) ? dot(value, vec3(1.0 / 3.0)) : value;\n }\n}\n\n/** Shadow filter marker (his `isFrameVolumeShadowFilter`). */\ntype VolumeFilter = ((inputs: N) => N) & { isVDBFrameVolumeShadowFilter?: true };\n\n/** The receivers of the core's volume shadow maps, owned by a {@link VDBFrameRenderer} (`frameRenderer.volumeShadows`). */\nexport class VDBFrameVolumeShadowReceivers {\n readonly entries = new Map<THREE.Light, VDBFrameShadowEntry>();\n readonly frameRenderer: VDBFrameRenderer;\n // NOTE Replaced shadow nodes, stand-ins and attributes. update() runs mid-render, so the next update() disposes them.\n retired: { dispose(): void }[] = [];\n renderCount = 0;\n #renderId = -1;\n #camera: THREE.Camera | null = null;\n #renderer: RendererLike | null = null;\n #names = 0;\n #placeholders: Placeholders | null = null;\n /** Map pieces drawn in the last update, and how many waited for the budget (not his; tests and timing). */\n readonly lastUpdate = { drawn: 0, waiting: 0 };\n\n constructor(frameRenderer: VDBFrameRenderer) {\n this.frameRenderer = frameRenderer;\n }\n\n /**\n * The map size of the settings (`castShadowMapSize`, or his coarse size). The core clamps it to the device's limits\n * (K6.10a); `sync` takes the size of the map the core made.\n */\n getMapSize(): number {\n const { settings } = this.frameRenderer;\n return settings.castShadowCoarse ? frameShadowCoarseMapSize : Math.max(1, Math.round(settings.castShadowMapSize));\n }\n\n #entry(light: ShadowLight): VDBFrameShadowEntry {\n let entry = this.entries.get(light);\n if (entry) return entry;\n const isPoint = (light as THREE.PointLight).isPointLight === true;\n entry = {\n light,\n isPoint,\n size: this.getMapSize(),\n coreMap: null,\n lastDraw: -1,\n userFilter: null,\n texture: null,\n binding: new VDBCoreTextureBinding(isPoint ? \"cube\" : \"2d-array\"),\n rgbTexture: null,\n rgbBinding: new VDBCoreTextureBinding(isPoint ? \"cube\" : \"2d-array\"),\n viewBuffer: null,\n nodes: null,\n };\n this.entries.set(light, entry);\n return entry;\n }\n\n #placeholdersOf(device: GPUDevice): Placeholders {\n const p = this.#placeholders;\n if (p && p.device === device) return p;\n this.#destroyPlaceholders();\n const make = (layers: number, what: string) =>\n device.createTexture({ label: `@pmndrs/vdb/three volume shadow placeholder ${what}`, size: [1, 1, layers], format: \"rgba16float\", usage: 0x04 /* TEXTURE_BINDING */ });\n // A zero view: info.w (enabled) 0, so every receiver function returns 1 without sampling\n const view = device.createBuffer({ label: \"@pmndrs/vdb/three volume shadow placeholder view\", size: VDB_VOLUME_SHADOW_VIEW.size, usage: 0x80 /* STORAGE */ });\n return (this.#placeholders = { device, array: make(1, \"2d-array\"), cube: make(6, \"cube\"), view });\n }\n\n #destroyPlaceholders(): void {\n const p = this.#placeholders;\n if (!p) return;\n // NOTE A bind group of this render may still name them: destroy after the task that submits it\n const destroy = () => {\n p.array.destroy();\n p.cube.destroy();\n p.view.destroy();\n };\n setTimeout(destroy, 0);\n this.#placeholders = null;\n }\n\n /**\n * The light's texture and view nodes (made at its first receiver build, bound to placeholders until the core draws a\n * map). @internal\n */\n nodesOf(entry: VDBFrameShadowEntry): EntryNodes {\n if (entry.nodes) return entry.nodes;\n const renderer = this.#renderer;\n if (!renderer) throw new Error(\"VDBFrameVolumeShadowReceivers: a receiver was built before update() saw the renderer\");\n const p = this.#placeholdersOf(getDevice(renderer as never));\n entry.binding.set(entry.texture ?? (entry.isPoint ? p.cube : p.array));\n entry.rgbBinding.set(entry.rgbTexture ?? (entry.isPoint ? p.cube : p.array));\n const make = entry.isPoint ? cubeTexture : texture;\n const k = this.#names++;\n const view = storage(this.#viewStandIn(entry.viewBuffer ?? p.view, k), \"uvec4\", VIEW_WORDS).toReadOnly() as StorageNode;\n view.setName(`vdbShadowView${k}`);\n entry.nodes = {\n k,\n map: make(entry.binding.texture),\n rgb: make(entry.rgbBinding.texture),\n view,\n loader: new VDBFrameStructLoaderNode(view, VDB_VOLUME_SHADOW_VIEW, `vdbFrameShadowView${k}`),\n fns: new Map(),\n };\n return entry.nodes;\n }\n\n #viewStandIn(buffer: GPUBuffer, k: number): StorageBufferAttribute {\n return vdbThreeStorageStandIn(this.#renderer!, buffer, `vdbShadowView${k}`);\n }\n\n /** The `wgslFn` of a light's receivers (grey or rgb; the point variants take no view depth). @internal */\n receiverFn(entry: VDBFrameShadowEntry, rgb: boolean): (inputs: Record<string, N>) => N {\n const nodes = this.nodesOf(entry);\n const key = rgb ? \"rgb\" : \"grey\";\n let fn = nodes.fns.get(key);\n if (fn) return fn;\n const view = `${nodes.loader.fnName}()`;\n const name = `${nodes.loader.fnName.replace(\"View\", \"Receiver\")}${rgb ? \"Rgb\" : \"\"}`;\n const map = entry.isPoint ? \"texture_cube<f32>\" : \"texture_2d_array<f32>\";\n const source = entry.isPoint\n ? rgb\n ? `fn ${name}(map: ${map}, rgb: ${map}, smp: sampler, world: vec3f) -> vec3f {\\n return vdbVolumeShadowCubeRgb(map, rgb, smp, ${view}, world);\\n}`\n : `fn ${name}(map: ${map}, smp: sampler, world: vec3f) -> f32 {\\n return vdbVolumeShadowCube(map, smp, ${view}, world);\\n}`\n : rgb\n ? `fn ${name}(map: ${map}, rgb: ${map}, smp: sampler, world: vec3f, viewDepth: f32) -> vec3f {\\n return vdbVolumeShadowRgb(map, rgb, smp, ${view}, world, viewDepth);\\n}`\n : `fn ${name}(map: ${map}, smp: sampler, world: vec3f, viewDepth: f32) -> f32 {\\n return vdbVolumeShadow(map, smp, ${view}, world, viewDepth);\\n}`;\n fn = wgslFn(source, [receiverCodeNode(), nodes.loader]) as (inputs: Record<string, N>) => N;\n nodes.fns.set(key, fn);\n return fn;\n }\n\n // NOTE Frees a light's entry and puts back its own filter. Receivers build again without the volume shadow.\n #free(entry: VDBFrameShadowEntry): void {\n const { light } = entry;\n const shadow = light.shadow as THREE.LightShadow & { filterNode?: VolumeFilter | null };\n // NOTE Receivers that still have the volume shadow node until they build again read the placeholders\n this.#bind(entry, null);\n if (shadow.filterNode?.isVDBFrameVolumeShadowFilter) shadow.filterNode = entry.userFilter as VolumeFilter | null;\n const old = resetLightShadow(light);\n if (old) this.retired.push(old);\n this.retired.push(entry.binding, entry.rgbBinding);\n if (entry.nodes) this.retired.push(entry.nodes.view.value as StorageBufferAttribute);\n this.entries.delete(light);\n }\n\n #disposeRetired(): void {\n this.retired.forEach((resource) => resource.dispose());\n this.retired.length = 0;\n }\n\n /**\n * Puts the volume filter on each shadow light (new lights and new filters are found each render); frees the entries\n * of lights with no shadow or not in a scene, and all entries when `castShadows` is off.\n */\n update(renderer: RendererLike, scene: THREE.Object3D): void {\n this.#disposeRetired();\n this.#renderer = renderer;\n if (!this.frameRenderer.settings.castShadows) {\n this.entries.forEach((entry) => this.#free(entry));\n return;\n }\n // NOTE The light-shadow reset (three internal) is self-tested before the first filter goes on a light\n vdbFrameCheckLightReset();\n this.entries.forEach((entry) => {\n if (!isShadowLight(entry.light) || !isInScene(entry.light)) this.#free(entry);\n });\n scene.traverse((light) => {\n if (isShadowLight(light)) this.#install(renderer, light);\n });\n }\n\n #install(renderer: RendererLike, light: ShadowLight): void {\n const shadow = light.shadow as THREE.LightShadow & { filterNode?: VolumeFilter | null; map: THREE.RenderTarget | null };\n if (shadow.filterNode?.isVDBFrameVolumeShadowFilter) return;\n const entry = this.#entry(light);\n const userFilter = (shadow.filterNode as VolumeFilter | null | undefined) ?? null;\n const filters = vdbFrameShadowFilters();\n entry.userFilter = userFilter;\n // NOTE ShadowNode calls the filter when it builds. The base filter is three's or the user's.\n // Point lights give the direction from the light (bd3D), other lights give shadowCoord. The volume shadow node\n // does not use them: it finds its map coordinate from the drawn state.\n const filter: VolumeFilter = (inputs) => {\n vdbFrameCheckFilterInputs(inputs, entry.isPoint);\n const type = renderer.shadowMap.type as number;\n const baseFilter = (userFilter ?? (entry.isPoint ? (type === THREE.BasicShadowMap ? filters.basicPoint : filters.point) : filters.maps[type])) as ((i: unknown) => N) | null;\n if (!baseFilter) throw new Error(\"THREE.WebGPURenderer: Shadow map type not supported yet.\");\n // NOTE PointShadowNode calls the filter in a TSL function, and its parameter proxy loses the shadow object.\n // So the base filter gets a plain object with the light shadow.\n const baseInputs: Record<string, unknown> = entry.isPoint\n ? { depthTexture: inputs.depthTexture, bd3D: inputs.bd3D, dp: inputs.dp, distance: inputs.distance }\n : { depthTexture: inputs.depthTexture, shadowCoord: inputs.shadowCoord, depthLayer: inputs.depthLayer };\n baseInputs.shadow = shadow;\n return baseFilter(baseInputs).mul(new VDBFrameVolumeShadowNode(this, entry));\n };\n filter.isVDBFrameVolumeShadowFilter = true;\n shadow.filterNode = filter;\n // NOTE The map exists when the shadow node was built before this filter\n if (shadow.map) {\n const old = resetLightShadow(light);\n if (old) this.retired.push(old);\n }\n }\n\n /** Called by the receivers of every light: the core update of this render (once per render and camera). */\n render(renderer: RendererLike, scene: THREE.Scene, camera: THREE.Camera, renderId: number): void {\n if (this.#renderId === renderId && this.#camera === camera) return;\n this.#renderId = renderId;\n this.#camera = camera;\n this.frameRenderer.coreFrame(renderer as never, scene as never, camera);\n }\n\n /**\n * Points a light's nodes at a core map (null: the placeholders). The texture and storage nodes keep their identity;\n * a new core texture or buffer gets a new stand-in as the node's `value`, and the old attribute is disposed at the next\n * update. Returns whether anything changed (the caller rebuilds the receivers: see `sync`).\n */\n #bind(entry: VDBFrameShadowEntry, m: VDBVolumeShadowMap | null): boolean {\n entry.coreMap = m;\n const nodes = entry.nodes;\n const p = nodes ? this.#placeholders : null;\n const texture = m?.texture ?? null;\n const rgb = m?.rgbTexture ?? null;\n const view = m?.view ?? null;\n const changed = texture !== entry.texture || rgb !== entry.rgbTexture || view !== entry.viewBuffer;\n if (texture !== entry.texture) {\n entry.texture = texture;\n if (nodes && p) this.#setTexture(entry.binding, nodes.map, texture ?? (entry.isPoint ? p.cube : p.array));\n }\n if (rgb !== entry.rgbTexture) {\n entry.rgbTexture = rgb;\n if (nodes && p) this.#setTexture(entry.rgbBinding, nodes.rgb, rgb ?? (entry.isPoint ? p.cube : p.array));\n }\n if (view !== entry.viewBuffer) {\n entry.viewBuffer = view;\n if (nodes && p) {\n const old = nodes.view.value as StorageBufferAttribute;\n nodes.view.value = this.#viewStandIn(view ?? p.view, nodes.k);\n this.retired.push(old);\n }\n }\n return changed;\n }\n\n // NOTE VDBCoreTextureBinding.set disposes the old stand-in at once; three keeps the GPU texture it bound (an\n // ExternalTexture's dispose never destroys it) and rebinds the node's new value at the next draw\n #setTexture(binding: VDBCoreTextureBinding, node: N, gpu: GPUTexture): void {\n if (binding.set(gpu)) node.value = binding.texture;\n }\n\n /**\n * After a core update, each entry binds its core map (texture, rgb twin, view buffer) and reads the budget counters.\n * The map size, the cascades and the drawn views live in the view buffer, so only a new core object (the first map, a\n * new size, a spectral switch, a map that went away or came back) touches the receivers: their nodes get the new\n * stand-ins and the light's receivers rebuild. The rebuild is needed: three r187 re-reads the object-group bindings\n * (textures, storage buffers) of a plain material only on a full refresh, which a node `value` swap does not cause, so\n * a receiver drawn with a shared refresh would keep the old bind group, and with it a texture the core retires\n * (K6.10 finding 8). They rebuild at their next draw (the next render: this one may still draw with the old objects,\n * which the core keeps alive for two more updates).\n */\n sync(maps: ReadonlyMap<number | string, VDBVolumeShadowMap>, stats: { drawn: number; waiting: number }): void {\n this.renderCount++;\n this.lastUpdate.drawn = stats.drawn;\n this.lastUpdate.waiting = stats.waiting;\n this.entries.forEach((entry) => {\n const m = maps.get(entry.light.id) ?? null;\n if (this.#bind(entry, m) && entry.nodes) {\n const old = resetLightShadow(entry.light);\n if (old) this.retired.push(old);\n }\n if (!m) return;\n entry.size = m.size;\n entry.lastDraw = m.lastDraw[0] ?? entry.lastDraw;\n });\n }\n\n /** Puts back the filter of each light (a later render installs again). */\n dispose(): void {\n this.entries.forEach((entry) => this.#free(entry));\n this.#disposeRetired();\n this.#destroyPlaceholders();\n this.#renderId = -1;\n this.#camera = null;\n this.#renderer = null;\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A volume in the froxel renderer (his `FrameVolume`, R1 §2): a `Group` whose proxy mesh draws the
|
|
3
|
-
* frame. Its props are his (same names and defaults) for the ported subset;
|
|
4
|
-
*
|
|
3
|
+
* frame. Its props are his (same names and defaults) for the ported subset; the renderer copies them into the core's
|
|
4
|
+
* `VDBFrameVolumeParams` at each render.
|
|
5
5
|
*
|
|
6
6
|
* const source = vdbDenseTextures(wvdbDenseVolume(readWvdb(bytes)));
|
|
7
7
|
* const volume = new VDBFrameVolume(source, { extinction: 100 }); // box: the source's (volume.bbox)
|
|
@@ -17,15 +17,11 @@
|
|
|
17
17
|
* source made with `followImage` follows a `pool.replace` of its grid (a coarse-first swap), box included (G16a).
|
|
18
18
|
*/
|
|
19
19
|
import * as THREE from "three";
|
|
20
|
-
import
|
|
21
|
-
import type {
|
|
22
|
-
import type {
|
|
23
|
-
import type { VDBFrameShadowDensityMaterial } from "./shadow-density-material.js";
|
|
24
|
-
import type { VDBFrameEmissionDirectionMaterial } from "./emission-light.js";
|
|
25
|
-
import type { VDBFramePhase, VDBFramePhaseSource } from "./phase.js";
|
|
20
|
+
import { type VDBEmissionColor } from "../../core/frame/types.js";
|
|
21
|
+
import type { VDBFramePhaseName } from "../../core/frame/settings.js";
|
|
22
|
+
import type { VDBThreeVolumeSource } from "../volume-source.js";
|
|
26
23
|
import { type VDBFrameMediumVolumeProps } from "./medium.js";
|
|
27
24
|
import { type VDBFrameRenderer } from "./renderer.js";
|
|
28
|
-
import type { FrameVolumeRecord } from "./view.js";
|
|
29
25
|
/** Props of {@link VDBFrameVolume}: his `FrameVolume` props (names and defaults) for the ported subset. */
|
|
30
26
|
export interface VDBFrameVolumeProps {
|
|
31
27
|
/**
|
|
@@ -39,25 +35,33 @@ export interface VDBFrameVolumeProps {
|
|
|
39
35
|
* box; else the unit box at the origin). Read back as {@link VDBFrameVolume.bbox}.
|
|
40
36
|
*/
|
|
41
37
|
bbox?: THREE.Box3 | [[number, number, number], [number, number, number]];
|
|
38
|
+
/** Albedo (single-scattering colour) of the medium (default white). */
|
|
42
39
|
baseColor?: THREE.ColorRepresentation;
|
|
40
|
+
/** Colour added to the volume's own emission, so it shows without light (default black). */
|
|
43
41
|
scatterColor?: THREE.ColorRepresentation;
|
|
44
42
|
/** With normalizeDensity: optical depth of the longest box side at the mean density (default 100). */
|
|
45
43
|
extinction?: number;
|
|
46
|
-
/** Extinction scale of each channel (renderer `settings.spectral`; with `angstromExponent
|
|
44
|
+
/** Extinction scale of each channel (renderer `settings.spectral`; with `angstromExponent`). */
|
|
47
45
|
extinctionScale?: [number, number, number] | THREE.Vector3Like;
|
|
48
|
-
/** Ångström exponent of the extinction spectrum: a number or a name
|
|
46
|
+
/** Ångström exponent of the extinction spectrum: a number or a preset name (`'cloud'` 0, `'dust'`, `'smoke'`, `'air'`; default 'cloud': grey). */
|
|
49
47
|
angstromExponent?: string | number;
|
|
50
48
|
/**
|
|
51
49
|
* `'volume'` lighting only: this volume's phase, overriding the renderer's `settings.phase` (default: unset, the
|
|
52
50
|
* renderer's). `'frame'` lighting always uses the renderer's (one lighting pass for all volumes). The same for
|
|
53
51
|
* `phaseG`, `phaseBackG`, `phaseBackWeight` and `phaseGExponent`, field by field.
|
|
54
52
|
*/
|
|
55
|
-
phase?:
|
|
53
|
+
phase?: VDBFramePhaseName | null;
|
|
54
|
+
/** Forward `g` of this volume's phase in `'volume'` lighting (null: the renderer's). */
|
|
56
55
|
phaseG?: number | null;
|
|
56
|
+
/** Backward-lobe `g` in `'volume'` lighting (null: the renderer's). */
|
|
57
57
|
phaseBackG?: number | null;
|
|
58
|
+
/** Backward-lobe weight in `'volume'` lighting (null: the renderer's). */
|
|
58
59
|
phaseBackWeight?: number | null;
|
|
60
|
+
/** Wavelength exponent of `g` in spectral rendering (null: the renderer's). */
|
|
59
61
|
phaseGExponent?: number | null;
|
|
62
|
+
/** Multiplier of the density (default 1; divided by the mean density with `normalizeDensity`). */
|
|
60
63
|
densityScale?: number;
|
|
64
|
+
/** Divide `densityScale` by the mean density so `extinction` sets the optical depth (default true). */
|
|
61
65
|
normalizeDensity?: boolean;
|
|
62
66
|
/**
|
|
63
67
|
* The mean density `normalizeDensity` divides by (default: unset, the source's `stats.meanNonZero`, which follows
|
|
@@ -65,21 +69,35 @@ export interface VDBFrameVolumeProps {
|
|
|
65
69
|
* by the mean of all frames' non-zero texels (`FrameVolume.getDensityScale`).
|
|
66
70
|
*/
|
|
67
71
|
densityMean?: number | null;
|
|
72
|
+
/** Densities at or below this read as 0 (default 0). */
|
|
68
73
|
densityCutoff?: number;
|
|
74
|
+
/** Scales the optical depth of the shadow march (0 turns the volume's own shadow off; default 1). */
|
|
69
75
|
absorbance?: number;
|
|
76
|
+
/** Opacity of the composited volume, 0 to 1 (default 1). */
|
|
70
77
|
opacity?: number;
|
|
78
|
+
/** Multiplier of the emission (default 1). */
|
|
71
79
|
emissiveIntensity?: number;
|
|
72
80
|
/** Kelvin at emission values 0 and 1. */
|
|
73
81
|
temperatureRange?: [number, number];
|
|
82
|
+
/**
|
|
83
|
+
* Offset of the texture lookup in texture coordinates (default 0); a sparse source with a nonzero offset turns HDDA
|
|
84
|
+
* skipping off.
|
|
85
|
+
*/
|
|
74
86
|
offset3D?: THREE.Vector3Like;
|
|
87
|
+
/** Texture wrapping of the lookup (default clamp to edge); wrapping turns a sparse source's HDDA skipping off. */
|
|
75
88
|
wrap3D?: THREE.Wrapping;
|
|
76
|
-
/** Light types bitmask (
|
|
89
|
+
/** Light types bitmask (`VDB_FRAME_LIGHT_BITS`); default all (`VDB_FRAME_ALL_LIGHTS`). */
|
|
77
90
|
lights?: number;
|
|
91
|
+
/** Steps of the shadow march toward each light in `'volume'` lighting (default 32). */
|
|
78
92
|
shadowSteps?: number;
|
|
79
93
|
/** Sample the source's mip levels (default true; needs a source with a mip atlas). */
|
|
80
94
|
mipmaps?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
|
|
95
|
+
/**
|
|
96
|
+
* The emission colour (K6.5, core data): `'white'` (default), `{ spectrum: 'planck' | 'soot', exponent }` (his
|
|
97
|
+
* blackbody spectra), `{ lut }` (a 256-texel rgb row over log temperature 500–40,000 K) or `{ wgsl }` (a validated
|
|
98
|
+
* WGSL hook, `fn vdbEmissionColor(temperature: f32) -> vec3f`).
|
|
99
|
+
*/
|
|
100
|
+
emissionColor?: VDBEmissionColor;
|
|
83
101
|
/**
|
|
84
102
|
* HDDA empty-space skipping in the shadow march (sparse sources; K3.2). Skipped samples are exactly
|
|
85
103
|
* 0, so the image does not change (within float noise); dense sources ignore it. Default false (D30: on the Apple GPU it
|
|
@@ -88,46 +106,80 @@ export interface VDBFrameVolumeProps {
|
|
|
88
106
|
*/
|
|
89
107
|
hdda?: boolean;
|
|
90
108
|
}
|
|
109
|
+
/** The phase a volume draws with in `'volume'` lighting (its own fields where set, else the renderer's). */
|
|
110
|
+
export interface VDBFramePhaseSettings {
|
|
111
|
+
phase: VDBFramePhaseName;
|
|
112
|
+
phaseG: number;
|
|
113
|
+
phaseBackG: number;
|
|
114
|
+
phaseBackWeight: number;
|
|
115
|
+
phaseGExponent: number;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A volume drawn by the froxel renderer: a `Group` whose proxy mesh composites the volume's density and light over
|
|
119
|
+
* the scene (his `FrameVolume`). Add it to a scene and render as usual; its props are live fields.
|
|
120
|
+
*/
|
|
91
121
|
export declare class VDBFrameVolume extends THREE.Group {
|
|
122
|
+
/** Type flag. */
|
|
92
123
|
readonly isVDBFrameVolume: true;
|
|
124
|
+
/** The volume source the density (and emission) is read from. */
|
|
93
125
|
readonly source: VDBThreeVolumeSource;
|
|
94
|
-
|
|
126
|
+
/** The froxel renderer that draws this volume. */
|
|
95
127
|
readonly frameRenderer: VDBFrameRenderer;
|
|
128
|
+
/** The proxy mesh whose draw triggers the frame render and composites the volume. */
|
|
96
129
|
readonly proxy: THREE.Mesh<THREE.InstancedBufferGeometry>;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
emissionDirectionMaterial: VDBFrameEmissionDirectionMaterial | null;
|
|
105
|
-
readonly emissionColor: VDBVolumeNodesOptions["emissionColor"];
|
|
130
|
+
/** The unit box → the volume box in local space (his `boxMatrix`); follows {@link VDBFrameVolume.bbox}. */
|
|
131
|
+
readonly boxMatrix: THREE.Matrix4;
|
|
132
|
+
/** `matrixWorld × boxMatrix` of the last render (the core's `params.matrixWorld`). */
|
|
133
|
+
readonly boxMatrixWorld: THREE.Matrix4;
|
|
134
|
+
/** The emission colour; see {@link VDBFrameVolumeProps.emissionColor}. */
|
|
135
|
+
emissionColor: VDBEmissionColor | undefined;
|
|
136
|
+
/** Albedo of the medium; see {@link VDBFrameVolumeProps.baseColor}. */
|
|
106
137
|
baseColor: THREE.Color;
|
|
138
|
+
/** Colour added to the emission; see {@link VDBFrameVolumeProps.scatterColor}. */
|
|
107
139
|
scatterColor: THREE.Color;
|
|
140
|
+
/** Optical depth of the longest box side at the mean density (with `normalizeDensity`). */
|
|
108
141
|
extinction: number;
|
|
142
|
+
/** Extinction scale of each channel (spectral rendering). */
|
|
109
143
|
extinctionScale: THREE.Vector3;
|
|
144
|
+
/** Ångström exponent of the extinction spectrum: a number or a preset name. */
|
|
110
145
|
angstromExponent: string | number;
|
|
111
146
|
/** `'volume'` lighting: phase overrides (null: the renderer's `settings`); see {@link VDBFrameVolumeProps.phase}. */
|
|
112
|
-
phase:
|
|
147
|
+
phase: VDBFramePhaseName | null;
|
|
148
|
+
/** Forward `g` override of `'volume'` lighting (null: the renderer's). */
|
|
113
149
|
phaseG: number | null;
|
|
150
|
+
/** Backward-lobe `g` override (null: the renderer's). */
|
|
114
151
|
phaseBackG: number | null;
|
|
152
|
+
/** Backward-lobe weight override (null: the renderer's). */
|
|
115
153
|
phaseBackWeight: number | null;
|
|
154
|
+
/** Wavelength exponent of `g` override (null: the renderer's). */
|
|
116
155
|
phaseGExponent: number | null;
|
|
156
|
+
/** Multiplier of the density; see {@link VDBFrameVolumeProps.densityScale}. */
|
|
117
157
|
densityScale: number;
|
|
158
|
+
/** Whether the density scale is divided by the mean density. */
|
|
118
159
|
normalizeDensity: boolean;
|
|
119
160
|
/** See {@link VDBFrameVolumeProps.densityMean}; null: the source's mean. */
|
|
120
161
|
densityMean: number | null;
|
|
162
|
+
/** Densities at or below this read as 0. */
|
|
121
163
|
densityCutoff: number;
|
|
164
|
+
/** Scales the optical depth of the shadow march. */
|
|
122
165
|
absorbance: number;
|
|
166
|
+
/** Opacity of the composited volume, 0 to 1. */
|
|
123
167
|
opacity: number;
|
|
168
|
+
/** Multiplier of the emission. */
|
|
124
169
|
emissiveIntensity: number;
|
|
170
|
+
/** Kelvin at emission values 0 (x) and 1 (y). */
|
|
125
171
|
temperatureRange: THREE.Vector2;
|
|
172
|
+
/** Offset of the texture lookup in texture coordinates. */
|
|
126
173
|
offset3D: THREE.Vector3;
|
|
174
|
+
/** Texture wrapping of the lookup. */
|
|
127
175
|
wrap3D: THREE.Wrapping;
|
|
176
|
+
/** Light types bitmask (`VDB_FRAME_LIGHT_BITS`) this volume receives. */
|
|
128
177
|
lights: number;
|
|
178
|
+
/** Steps of the shadow march in `'volume'` lighting. */
|
|
129
179
|
shadowSteps: number;
|
|
180
|
+
/** Whether the source's mip levels are sampled. */
|
|
130
181
|
mipmaps: boolean;
|
|
182
|
+
/** Whether the sparse source's shadow march skips empty space (no effect on dense sources). */
|
|
131
183
|
hdda: boolean;
|
|
132
184
|
/**
|
|
133
185
|
* The volume's box in its local space: the `bbox` prop, else the source's box, re-read
|
|
@@ -138,16 +190,21 @@ export declare class VDBFrameVolume extends THREE.Group {
|
|
|
138
190
|
readonly bbox: THREE.Box3;
|
|
139
191
|
/** The medium fields at construction, for `setMedium(null)`. */
|
|
140
192
|
private readonly initialMedium;
|
|
141
|
-
/** `source.version` the
|
|
193
|
+
/** `source.version` the box was last read at. */
|
|
142
194
|
private sourceVersion;
|
|
143
195
|
/** G16a / RV: the box is the source's (no `bbox` prop), so it follows the source. */
|
|
144
196
|
private readonly boxFromSource;
|
|
145
197
|
private readonly resolvedPhase;
|
|
198
|
+
/**
|
|
199
|
+
* Makes a volume over a dense or sparse source. Throws `VDB_BAD_OPTION` for a source that is neither.
|
|
200
|
+
* @param source A source from `vdbDenseTextures()` or `vdbSparseSource()`.
|
|
201
|
+
* @param props {@link VDBFrameVolumeProps}; all optional.
|
|
202
|
+
*/
|
|
146
203
|
constructor(source: VDBThreeVolumeSource, props?: VDBFrameVolumeProps);
|
|
147
204
|
/** The mean density `normalizeDensity` divides by: `densityMean` when set, else the source's mean of the non-zero texels (his `meanDensity`). */
|
|
148
205
|
get meanDensity(): number;
|
|
149
206
|
/** The phase this volume is drawn with in `'volume'` lighting: its own `phase*` fields where set, else the renderer's `settings` (a reused object). */
|
|
150
|
-
getPhase(): Readonly<
|
|
207
|
+
getPhase(): Readonly<VDBFramePhaseSettings>;
|
|
151
208
|
/**
|
|
152
209
|
* A measured medium in one call (`'cloud'`, `'fog'`, `'ice'`, `'soot'`, `'white-smoke'`, `'dark-smoke'`, `'haze'`,
|
|
153
210
|
* `'dust'`, or {@link VDBFrameMediumVolumeProps} from `vdbFrameMedium`), as his GUI's 'Medium' field: the volume's
|
|
@@ -158,15 +215,16 @@ export declare class VDBFrameVolume extends THREE.Group {
|
|
|
158
215
|
* as it is). Returns the props applied (null for `null`); an unknown name throws `VDB_BAD_OPTION`.
|
|
159
216
|
*/
|
|
160
217
|
setMedium(medium: string | VDBFrameMediumVolumeProps | null): VDBFrameMediumVolumeProps | null;
|
|
161
|
-
/**
|
|
218
|
+
/** The density scale the renderer draws with: `densityScale`, divided by the mean density with `normalizeDensity`. */
|
|
162
219
|
getDensityScale(): number;
|
|
163
220
|
/**
|
|
164
|
-
* Re-
|
|
165
|
-
* every
|
|
221
|
+
* Re-reads the source's box (a dense frame with another `.wvdb` box, or a `followImage` sparse source after its grid's
|
|
222
|
+
* image changed). The renderer calls {@link VDBFrameVolume.syncSource} before every render, so a `source.replace()`
|
|
223
|
+
* needs no call; this forces it.
|
|
166
224
|
*/
|
|
167
225
|
updateSource(): void;
|
|
168
|
-
/** {@link VDBFrameVolume.updateSource} if the source changed since (its `version`: a resized dense frame, a replaced pool image). Cheap; called per
|
|
226
|
+
/** {@link VDBFrameVolume.updateSource} if the source changed since (its `version`: a resized dense frame, a replaced pool image). Cheap; called per render. */
|
|
169
227
|
syncSource(): void;
|
|
170
|
-
/** Frees the proxy geometry
|
|
228
|
+
/** Frees the proxy geometry. The source belongs to the caller; the renderer drops the volume when it leaves the scene. */
|
|
171
229
|
dispose(): void;
|
|
172
230
|
}
|