@pmndrs/vdb 0.0.0-stage → 0.1.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 +137 -0
- package/LICENSE +21 -0
- package/README.md +448 -2
- package/THIRD_PARTY_NOTICES.md +147 -0
- package/dist/core/compute/atlas.d.ts +94 -0
- package/dist/core/compute/atlas.js +98 -0
- package/dist/core/compute/atlas.js.map +1 -0
- package/dist/core/compute/index.d.ts +13 -0
- package/dist/core/compute/index.js +9 -0
- package/dist/core/compute/index.js.map +1 -0
- package/dist/core/compute/pyramid.d.ts +105 -0
- package/dist/core/compute/pyramid.js +455 -0
- package/dist/core/compute/pyramid.js.map +1 -0
- package/dist/core/compute/shared.d.ts +115 -0
- package/dist/core/compute/shared.js +211 -0
- package/dist/core/compute/shared.js.map +1 -0
- package/dist/core/compute/stats.d.ts +71 -0
- package/dist/core/compute/stats.js +188 -0
- package/dist/core/compute/stats.js.map +1 -0
- package/dist/core/compute/value-transform.d.ts +23 -0
- package/dist/core/compute/value-transform.js +58 -0
- package/dist/core/compute/value-transform.js.map +1 -0
- package/dist/core/errors.d.ts +11 -0
- package/dist/core/errors.js +9 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/index.d.ts +30 -0
- package/dist/core/index.js +27 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/internal.d.ts +15 -0
- package/dist/core/internal.js +15 -0
- package/dist/core/internal.js.map +1 -0
- package/dist/core/pool/affine.d.ts +34 -0
- package/dist/core/pool/affine.js +100 -0
- package/dist/core/pool/affine.js.map +1 -0
- package/dist/core/pool/allocator.d.ts +32 -0
- package/dist/core/pool/allocator.js +81 -0
- package/dist/core/pool/allocator.js.map +1 -0
- package/dist/core/pool/image-header.d.ts +82 -0
- package/dist/core/pool/image-header.js +175 -0
- package/dist/core/pool/image-header.js.map +1 -0
- package/dist/core/pool/layout.d.ts +164 -0
- package/dist/core/pool/layout.js +267 -0
- package/dist/core/pool/layout.js.map +1 -0
- package/dist/core/pool/limits.d.ts +40 -0
- package/dist/core/pool/limits.js +79 -0
- package/dist/core/pool/limits.js.map +1 -0
- package/dist/core/pool/pool.d.ts +279 -0
- package/dist/core/pool/pool.js +953 -0
- package/dist/core/pool/pool.js.map +1 -0
- package/dist/core/source/dense.d.ts +19 -0
- package/dist/core/source/dense.js +287 -0
- package/dist/core/source/dense.js.map +1 -0
- package/dist/core/source/types.d.ts +63 -0
- package/dist/core/source/types.js +9 -0
- package/dist/core/source/types.js.map +1 -0
- package/dist/core/types.d.ts +28 -0
- package/dist/core/types.js +28 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/wgsl/api.d.ts +41 -0
- package/dist/core/wgsl/api.js +463 -0
- package/dist/core/wgsl/api.js.map +1 -0
- package/dist/core/wgsl/generate.d.ts +82 -0
- package/dist/core/wgsl/generate.js +505 -0
- package/dist/core/wgsl/generate.js.map +1 -0
- package/dist/core/wgsl/level-set.d.ts +54 -0
- package/dist/core/wgsl/level-set.js +194 -0
- package/dist/core/wgsl/level-set.js.map +1 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +14 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.js +330 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -0
- package/dist/core/wgsl/reserved.d.ts +9 -0
- package/dist/core/wgsl/reserved.js +26 -0
- package/dist/core/wgsl/reserved.js.map +1 -0
- package/dist/core/wgsl/types.d.ts +104 -0
- package/dist/core/wgsl/types.js +2 -0
- package/dist/core/wgsl/types.js.map +1 -0
- package/dist/three/coarse-first.d.ts +162 -0
- package/dist/three/coarse-first.js +187 -0
- package/dist/three/coarse-first.js.map +1 -0
- package/dist/three/compute.d.ts +63 -0
- package/dist/three/compute.js +56 -0
- package/dist/three/compute.js.map +1 -0
- package/dist/three/device.d.ts +59 -0
- package/dist/three/device.js +59 -0
- package/dist/three/device.js.map +1 -0
- package/dist/three/frame/blackbody.d.ts +42 -0
- package/dist/three/frame/blackbody.js +74 -0
- package/dist/three/frame/blackbody.js.map +1 -0
- package/dist/three/frame/chunks.d.ts +157 -0
- package/dist/three/frame/chunks.js +559 -0
- package/dist/three/frame/chunks.js.map +1 -0
- package/dist/three/frame/density-material.d.ts +53 -0
- package/dist/three/frame/density-material.js +353 -0
- package/dist/three/frame/density-material.js.map +1 -0
- package/dist/three/frame/emission-light.d.ts +167 -0
- package/dist/three/frame/emission-light.js +655 -0
- package/dist/three/frame/emission-light.js.map +1 -0
- package/dist/three/frame/environment-grid-material.d.ts +21 -0
- package/dist/three/frame/environment-grid-material.js +184 -0
- package/dist/three/frame/environment-grid-material.js.map +1 -0
- package/dist/three/frame/environment-material.d.ts +22 -0
- package/dist/three/frame/environment-material.js +87 -0
- package/dist/three/frame/environment-material.js.map +1 -0
- package/dist/three/frame/grid-mip-material.d.ts +12 -0
- package/dist/three/frame/grid-mip-material.js +61 -0
- package/dist/three/frame/grid-mip-material.js.map +1 -0
- package/dist/three/frame/index.d.ts +39 -0
- package/dist/three/frame/index.js +35 -0
- package/dist/three/frame/index.js.map +1 -0
- package/dist/three/frame/inject-material.d.ts +56 -0
- package/dist/three/frame/inject-material.js +424 -0
- package/dist/three/frame/inject-material.js.map +1 -0
- package/dist/three/frame/integrate-material.d.ts +26 -0
- package/dist/three/frame/integrate-material.js +198 -0
- package/dist/three/frame/integrate-material.js.map +1 -0
- package/dist/three/frame/layout.d.ts +34 -0
- package/dist/three/frame/layout.js +48 -0
- package/dist/three/frame/layout.js.map +1 -0
- package/dist/three/frame/lighting-material.d.ts +41 -0
- package/dist/three/frame/lighting-material.js +257 -0
- package/dist/three/frame/lighting-material.js.map +1 -0
- package/dist/three/frame/lights.d.ts +11 -0
- package/dist/three/frame/lights.js +16 -0
- package/dist/three/frame/lights.js.map +1 -0
- package/dist/three/frame/medium.d.ts +21 -0
- package/dist/three/frame/medium.js +29 -0
- package/dist/three/frame/medium.js.map +1 -0
- package/dist/three/frame/neural.d.ts +14 -0
- package/dist/three/frame/neural.js +105 -0
- package/dist/three/frame/neural.js.map +1 -0
- package/dist/three/frame/phase.d.ts +44 -0
- package/dist/three/frame/phase.js +80 -0
- package/dist/three/frame/phase.js.map +1 -0
- package/dist/three/frame/renderer.d.ts +493 -0
- package/dist/three/frame/renderer.js +1498 -0
- package/dist/three/frame/renderer.js.map +1 -0
- package/dist/three/frame/shadow-density-material.d.ts +30 -0
- package/dist/three/frame/shadow-density-material.js +123 -0
- package/dist/three/frame/shadow-density-material.js.map +1 -0
- package/dist/three/frame/spectrum.d.ts +18 -0
- package/dist/three/frame/spectrum.js +36 -0
- package/dist/three/frame/spectrum.js.map +1 -0
- package/dist/three/frame/temporal-material.d.ts +29 -0
- package/dist/three/frame/temporal-material.js +152 -0
- package/dist/three/frame/temporal-material.js.map +1 -0
- package/dist/three/frame/three-internals.d.ts +65 -0
- package/dist/three/frame/three-internals.js +150 -0
- package/dist/three/frame/three-internals.js.map +1 -0
- package/dist/three/frame/transmittance-material.d.ts +31 -0
- package/dist/three/frame/transmittance-material.js +315 -0
- package/dist/three/frame/transmittance-material.js.map +1 -0
- package/dist/three/frame/view.d.ts +103 -0
- package/dist/three/frame/view.js +296 -0
- package/dist/three/frame/view.js.map +1 -0
- package/dist/three/frame/volume-shadow-material.d.ts +36 -0
- package/dist/three/frame/volume-shadow-material.js +128 -0
- package/dist/three/frame/volume-shadow-material.js.map +1 -0
- package/dist/three/frame/volume-shadows.d.ts +153 -0
- package/dist/three/frame/volume-shadows.js +756 -0
- package/dist/three/frame/volume-shadows.js.map +1 -0
- package/dist/three/frame/volume.d.ts +172 -0
- package/dist/three/frame/volume.js +256 -0
- package/dist/three/frame/volume.js.map +1 -0
- package/dist/three/grid-node.d.ts +196 -0
- package/dist/three/grid-node.js +510 -0
- package/dist/three/grid-node.js.map +1 -0
- package/dist/three/index.d.ts +43 -0
- package/dist/three/index.js +49 -0
- package/dist/three/index.js.map +1 -0
- package/dist/three/internal.d.ts +14 -0
- package/dist/three/internal.js +14 -0
- package/dist/three/internal.js.map +1 -0
- package/dist/three/level-set-material.d.ts +112 -0
- package/dist/three/level-set-material.js +204 -0
- package/dist/three/level-set-material.js.map +1 -0
- package/dist/three/material.d.ts +194 -0
- package/dist/three/material.js +359 -0
- package/dist/three/material.js.map +1 -0
- package/dist/three/points.d.ts +84 -0
- package/dist/three/points.js +130 -0
- package/dist/three/points.js.map +1 -0
- package/dist/three/sequence.d.ts +317 -0
- package/dist/three/sequence.js +526 -0
- package/dist/three/sequence.js.map +1 -0
- package/dist/three/sparse-source.d.ts +233 -0
- package/dist/three/sparse-source.js +876 -0
- package/dist/three/sparse-source.js.map +1 -0
- package/dist/three/volume-source.d.ts +167 -0
- package/dist/three/volume-source.js +353 -0
- package/dist/three/volume-source.js.map +1 -0
- package/dist/tools/cpu/compute.d.ts +97 -0
- package/dist/tools/cpu/compute.js +218 -0
- package/dist/tools/cpu/compute.js.map +1 -0
- package/dist/tools/cpu/level-set.d.ts +72 -0
- package/dist/tools/cpu/level-set.js +261 -0
- package/dist/tools/cpu/level-set.js.map +1 -0
- package/dist/tools/cpu/march.d.ts +206 -0
- package/dist/tools/cpu/march.js +575 -0
- package/dist/tools/cpu/march.js.map +1 -0
- package/dist/tools/cpu/probe-coords.d.ts +70 -0
- package/dist/tools/cpu/probe-coords.js +116 -0
- package/dist/tools/cpu/probe-coords.js.map +1 -0
- package/dist/tools/cpu/read-value.d.ts +31 -0
- package/dist/tools/cpu/read-value.js +336 -0
- package/dist/tools/cpu/read-value.js.map +1 -0
- package/dist/tools/cpu/sample-trilinear.d.ts +30 -0
- package/dist/tools/cpu/sample-trilinear.js +156 -0
- package/dist/tools/cpu/sample-trilinear.js.map +1 -0
- package/dist/tools/cpu/stride-tables.d.ts +56 -0
- package/dist/tools/cpu/stride-tables.generated.d.ts +1058 -0
- package/dist/tools/cpu/stride-tables.generated.js +1266 -0
- package/dist/tools/cpu/stride-tables.generated.js.map +1 -0
- package/dist/tools/cpu/stride-tables.js +78 -0
- package/dist/tools/cpu/stride-tables.js.map +1 -0
- package/dist/tools/errors.d.ts +57 -0
- package/dist/tools/errors.js +58 -0
- package/dist/tools/errors.js.map +1 -0
- package/dist/tools/frame/blackbody.d.ts +42 -0
- package/dist/tools/frame/blackbody.js +116 -0
- package/dist/tools/frame/blackbody.js.map +1 -0
- package/dist/tools/frame/emission.d.ts +128 -0
- package/dist/tools/frame/emission.js +282 -0
- package/dist/tools/frame/emission.js.map +1 -0
- package/dist/tools/frame/environment.d.ts +105 -0
- package/dist/tools/frame/environment.js +268 -0
- package/dist/tools/frame/environment.js.map +1 -0
- package/dist/tools/frame/grid.d.ts +302 -0
- package/dist/tools/frame/grid.js +703 -0
- package/dist/tools/frame/grid.js.map +1 -0
- package/dist/tools/frame/index.d.ts +136 -0
- package/dist/tools/frame/index.js +348 -0
- package/dist/tools/frame/index.js.map +1 -0
- package/dist/tools/frame/medium.d.ts +61 -0
- package/dist/tools/frame/medium.js +99 -0
- package/dist/tools/frame/medium.js.map +1 -0
- package/dist/tools/frame/mie-table.d.ts +6 -0
- package/dist/tools/frame/mie-table.js +16 -0
- package/dist/tools/frame/mie-table.js.map +1 -0
- package/dist/tools/frame/mie.d.ts +54 -0
- package/dist/tools/frame/mie.js +176 -0
- package/dist/tools/frame/mie.js.map +1 -0
- package/dist/tools/frame/neural-weights.d.ts +9 -0
- package/dist/tools/frame/neural-weights.js +245 -0
- package/dist/tools/frame/neural-weights.js.map +1 -0
- package/dist/tools/frame/neural.d.ts +80 -0
- package/dist/tools/frame/neural.js +150 -0
- package/dist/tools/frame/neural.js.map +1 -0
- package/dist/tools/frame/pyramid-layout.d.ts +38 -0
- package/dist/tools/frame/pyramid-layout.js +53 -0
- package/dist/tools/frame/pyramid-layout.js.map +1 -0
- package/dist/tools/frame/shadows.d.ts +80 -0
- package/dist/tools/frame/shadows.js +182 -0
- package/dist/tools/frame/shadows.js.map +1 -0
- package/dist/tools/frame/sparse.d.ts +65 -0
- package/dist/tools/frame/sparse.js +191 -0
- package/dist/tools/frame/sparse.js.map +1 -0
- package/dist/tools/frame/spectral.d.ts +203 -0
- package/dist/tools/frame/spectral.js +550 -0
- package/dist/tools/frame/spectral.js.map +1 -0
- package/dist/tools/index.d.ts +106 -0
- package/dist/tools/index.js +88 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/internal.d.ts +46 -0
- package/dist/tools/internal.js +31 -0
- package/dist/tools/internal.js.map +1 -0
- package/dist/tools/nanovdb/build-from-vdb.d.ts +50 -0
- package/dist/tools/nanovdb/build-from-vdb.js +92 -0
- package/dist/tools/nanovdb/build-from-vdb.js.map +1 -0
- package/dist/tools/nanovdb/bytes.d.ts +220 -0
- package/dist/tools/nanovdb/bytes.js +345 -0
- package/dist/tools/nanovdb/bytes.js.map +1 -0
- package/dist/tools/nanovdb/coarse-first.d.ts +62 -0
- package/dist/tools/nanovdb/coarse-first.js +86 -0
- package/dist/tools/nanovdb/coarse-first.js.map +1 -0
- package/dist/tools/nanovdb/index.d.ts +32 -0
- package/dist/tools/nanovdb/index.js +24 -0
- package/dist/tools/nanovdb/index.js.map +1 -0
- package/dist/tools/nanovdb/inspect.d.ts +24 -0
- package/dist/tools/nanovdb/inspect.js +63 -0
- package/dist/tools/nanovdb/inspect.js.map +1 -0
- package/dist/tools/nanovdb/leaf-codec.d.ts +85 -0
- package/dist/tools/nanovdb/leaf-codec.js +320 -0
- package/dist/tools/nanovdb/leaf-codec.js.map +1 -0
- package/dist/tools/nanovdb/quantize.d.ts +43 -0
- package/dist/tools/nanovdb/quantize.js +277 -0
- package/dist/tools/nanovdb/quantize.js.map +1 -0
- package/dist/tools/nanovdb/resample.d.ts +160 -0
- package/dist/tools/nanovdb/resample.js +679 -0
- package/dist/tools/nanovdb/resample.js.map +1 -0
- package/dist/tools/nanovdb/serialize.d.ts +145 -0
- package/dist/tools/nanovdb/serialize.js +395 -0
- package/dist/tools/nanovdb/serialize.js.map +1 -0
- package/dist/tools/nanovdb/stats.d.ts +58 -0
- package/dist/tools/nanovdb/stats.js +149 -0
- package/dist/tools/nanovdb/stats.js.map +1 -0
- package/dist/tools/nanovdb/transform.d.ts +26 -0
- package/dist/tools/nanovdb/transform.js +91 -0
- package/dist/tools/nanovdb/transform.js.map +1 -0
- package/dist/tools/nanovdb/tree.d.ts +175 -0
- package/dist/tools/nanovdb/tree.js +518 -0
- package/dist/tools/nanovdb/tree.js.map +1 -0
- package/dist/tools/nanovdb/write-nvdb.d.ts +39 -0
- package/dist/tools/nanovdb/write-nvdb.js +210 -0
- package/dist/tools/nanovdb/write-nvdb.js.map +1 -0
- package/dist/tools/nvdb-file.d.ts +195 -0
- package/dist/tools/nvdb-file.js +606 -0
- package/dist/tools/nvdb-file.js.map +1 -0
- package/dist/tools/nvdb-stream.d.ts +138 -0
- package/dist/tools/nvdb-stream.js +365 -0
- package/dist/tools/nvdb-stream.js.map +1 -0
- package/dist/tools/vdb/bit-utils.d.ts +20 -0
- package/dist/tools/vdb/bit-utils.js +42 -0
- package/dist/tools/vdb/bit-utils.js.map +1 -0
- package/dist/tools/vdb/blosc.d.ts +56 -0
- package/dist/tools/vdb/blosc.js +231 -0
- package/dist/tools/vdb/blosc.js.map +1 -0
- package/dist/tools/vdb/byte-reader.d.ts +40 -0
- package/dist/tools/vdb/byte-reader.js +139 -0
- package/dist/tools/vdb/byte-reader.js.map +1 -0
- package/dist/tools/vdb/compression.d.ts +73 -0
- package/dist/tools/vdb/compression.js +249 -0
- package/dist/tools/vdb/compression.js.map +1 -0
- package/dist/tools/vdb/errors.d.ts +10 -0
- package/dist/tools/vdb/errors.js +11 -0
- package/dist/tools/vdb/errors.js.map +1 -0
- package/dist/tools/vdb/grid.d.ts +37 -0
- package/dist/tools/vdb/grid.js +147 -0
- package/dist/tools/vdb/grid.js.map +1 -0
- package/dist/tools/vdb/half-float.d.ts +9 -0
- package/dist/tools/vdb/half-float.js +24 -0
- package/dist/tools/vdb/half-float.js.map +1 -0
- package/dist/tools/vdb/index.d.ts +3 -0
- package/dist/tools/vdb/index.js +3 -0
- package/dist/tools/vdb/index.js.map +1 -0
- package/dist/tools/vdb/inflate.d.ts +24 -0
- package/dist/tools/vdb/inflate.js +334 -0
- package/dist/tools/vdb/inflate.js.map +1 -0
- package/dist/tools/vdb/metadata.d.ts +17 -0
- package/dist/tools/vdb/metadata.js +72 -0
- package/dist/tools/vdb/metadata.js.map +1 -0
- package/dist/tools/vdb/parse.d.ts +25 -0
- package/dist/tools/vdb/parse.js +171 -0
- package/dist/tools/vdb/parse.js.map +1 -0
- package/dist/tools/vdb/point-render-data.d.ts +31 -0
- package/dist/tools/vdb/point-render-data.js +57 -0
- package/dist/tools/vdb/point-render-data.js.map +1 -0
- package/dist/tools/vdb/points.d.ts +160 -0
- package/dist/tools/vdb/points.js +794 -0
- package/dist/tools/vdb/points.js.map +1 -0
- package/dist/tools/vdb/transform.d.ts +23 -0
- package/dist/tools/vdb/transform.js +54 -0
- package/dist/tools/vdb/transform.js.map +1 -0
- package/dist/tools/vdb/tree.d.ts +111 -0
- package/dist/tools/vdb/tree.js +228 -0
- package/dist/tools/vdb/tree.js.map +1 -0
- package/dist/tools/vdb/types.d.ts +138 -0
- package/dist/tools/vdb/types.js +3 -0
- package/dist/tools/vdb/types.js.map +1 -0
- package/dist/tools/wvdb/bake.d.ts +116 -0
- package/dist/tools/wvdb/bake.js +311 -0
- package/dist/tools/wvdb/bake.js.map +1 -0
- package/dist/tools/wvdb/dense.d.ts +112 -0
- package/dist/tools/wvdb/dense.js +309 -0
- package/dist/tools/wvdb/dense.js.map +1 -0
- package/dist/tools/wvdb/format.d.ts +161 -0
- package/dist/tools/wvdb/format.js +303 -0
- package/dist/tools/wvdb/format.js.map +1 -0
- package/dist/tools/wvdb/index.d.ts +13 -0
- package/dist/tools/wvdb/index.js +14 -0
- package/dist/tools/wvdb/index.js.map +1 -0
- package/dist/tools/wvdb/level-set.d.ts +48 -0
- package/dist/tools/wvdb/level-set.js +153 -0
- package/dist/tools/wvdb/level-set.js.map +1 -0
- package/dist/tools/wvdb/nanovdb.d.ts +54 -0
- package/dist/tools/wvdb/nanovdb.js +60 -0
- package/dist/tools/wvdb/nanovdb.js.map +1 -0
- package/dist/tools/wvdb/read.d.ts +260 -0
- package/dist/tools/wvdb/read.js +743 -0
- package/dist/tools/wvdb/read.js.map +1 -0
- package/dist/tools/wvdb/sha256.d.ts +7 -0
- package/dist/tools/wvdb/sha256.js +76 -0
- package/dist/tools/wvdb/sha256.js.map +1 -0
- package/dist/tools/wvdb/write.d.ts +127 -0
- package/dist/tools/wvdb/write.js +396 -0
- package/dist/tools/wvdb/write.js.map +1 -0
- package/package.json +82 -4
- package/vendor/LICENSE +201 -0
- package/vendor/NOTICE +19 -0
- package/vendor/VENDOR.md +85 -0
- package/vendor/pnanovdb.wgsl +1539 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"volume.js","sourceRoot":"","sources":["../../../src/three/frame/volume.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,mGAAmG;AACnG,mFAAmF;AACnF,4GAA4G;AAC5G,0HAA0H;AAC1H,gGAAgG;AAChG,mGAAmG;AACnG,WAAW;AAEX;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAKxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAkC,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAyB,MAAM,eAAe,CAAC;AAGxE,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAiEjC,MAAM,KAAK,GAAG,CAAC,IAAiC,EAAE,MAA4B,EAAc,EAAE;IAC5F,IAAI,IAAI,YAAY,KAAK,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,KAAK,EAAE,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,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO;oBAAE,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;IACH,CAAC;IAED,6JAA6J;IAC7J,UAAU;QACR,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,YAAY,EAAE,CAAC;IACtE,CAAC;IAED,wIAAwI;IACxI,OAAO;QACL,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,qBAAqB,EAAE,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,yBAAyB,EAAE,OAAO,EAAE,CAAC;QAC1C,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACF","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/core/FrameVolume.js L8–11 (render order, all lights), L152–270 (props,\n// proxy), L339–353 (box matrix), L554–568 (getDensityScale), L624–650 (dispose).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: TypeScript; takes a VDBVolumeSource (dense `.wvdb`, or the sparse pool since K3.2) instead of resampling grids\n// on the CPU (his L279–552: conversion, progressive upload, level sets, points, instances); one\n// volume per frame volume; the mean density is the source's. Divergences: DIVERGES.md (K3.1 rows),\n// V23–V25.\n\n/**\n * A volume in the froxel renderer (his `FrameVolume`, R1 §2): a `Group` whose proxy mesh draws the\n * frame. Its props are his (same names and defaults) for the ported subset; density is read only\n * through the source's nodes (`vdbVolumeNodes`), so Step 2 swaps in the sparse source.\n *\n * const source = vdbDenseTextures(wvdbDenseVolume(readWvdb(bytes)));\n * const volume = new VDBFrameVolume(source, { extinction: 100 }); // box: the source's (volume.bbox)\n * scene.add(volume); // then renderer.render(scene, camera) as usual\n * volume.frameRenderer.settings.multipleScattering = false;\n * volume.setMedium(\"fog\"); // a measured medium: albedo, spectrum, the renderer's phase\n *\n * The phase (K5.9): the renderer's `settings.phase*` is the phase of every volume it draws. `'frame'`\n * lighting lights all volumes in one pass with it; in `'volume'` lighting (each volume marches its own\n * light) a volume's own `phase*` props, when set, override it for that volume. The source (dense or\n * sparse), its kind and its LOD are fixed at construction: make a new source and a new volume to change\n * them (`source.replace` swaps a dense frame of the same channels; the volume follows it by itself). A sparse\n * source made with `followImage` follows a `pool.replace` of its grid (a coarse-first swap), box included (G16a).\n */\n\nimport * as THREE from \"three\";\nimport { VDBError } from \"../../core/errors.js\";\nimport type { VDBThreeVolumeSource, VDBVolumeNodesOptions, VDBVolumeUniforms } from \"../volume-source.js\";\nimport { vdbVolumeUniforms } from \"../volume-source.js\";\nimport type { VDBFrameDensityMaterial } from \"./density-material.js\";\nimport type { VDBFrameInjectMaterial } from \"./inject-material.js\";\nimport type { VDBFrameShadowDensityMaterial } from \"./shadow-density-material.js\";\nimport type { VDBFrameEmissionDirectionMaterial } from \"./emission-light.js\";\nimport { vdbFrameAllLights } from \"./lights.js\";\nimport type { VDBFramePhase, VDBFramePhaseSource } from \"./phase.js\";\nimport { getFrameMediumProps, type VDBFrameMediumVolumeProps } from \"./medium.js\";\nimport { vdbFrameRenderer, type VDBFrameRenderer } from \"./renderer.js\";\nimport type { FrameVolumeRecord } from \"./view.js\";\n\n// NOTE Draw the frame after all other transparent objects\nconst frameRenderOrder = 1000000;\n\n/** Props of {@link VDBFrameVolume}: his `FrameVolume` props (names and defaults) for the ported subset. */\nexport interface VDBFrameVolumeProps {\n /**\n * The froxel renderer (default: the shared {@link vdbFrameRenderer}). Its `settings` apply to every\n * volume that uses it; pass your own `new VDBFrameRenderer()` (or `vdbFrameRenderer(threeRenderer)`)\n * for separate settings.\n */\n frameRenderer?: VDBFrameRenderer;\n /**\n * Box of the volume in its local space (default: the source's box: the `.wvdb` bbox or the sparse grid's world\n * box; else the unit box at the origin). Read back as {@link VDBFrameVolume.bbox}.\n */\n bbox?: THREE.Box3 | [[number, number, number], [number, number, number]];\n baseColor?: THREE.ColorRepresentation;\n scatterColor?: THREE.ColorRepresentation;\n /** With normalizeDensity: optical depth of the longest box side at the mean density (default 100). */\n extinction?: number;\n /** Extinction scale of each channel (renderer `settings.spectral`; with `angstromExponent`, spectrum.ts). */\n extinctionScale?: [number, number, number] | THREE.Vector3Like;\n /** Ångström exponent of the extinction spectrum: a number or a name of `frameAngstromExponents` (default 'cloud': 0, grey). */\n angstromExponent?: string | number;\n /**\n * `'volume'` lighting only: this volume's phase, overriding the renderer's `settings.phase` (default: unset, the\n * renderer's). `'frame'` lighting always uses the renderer's (one lighting pass for all volumes). The same for\n * `phaseG`, `phaseBackG`, `phaseBackWeight` and `phaseGExponent`, field by field.\n */\n phase?: VDBFramePhase | null;\n phaseG?: number | null;\n phaseBackG?: number | null;\n phaseBackWeight?: number | null;\n phaseGExponent?: number | null;\n densityScale?: number;\n normalizeDensity?: boolean;\n /**\n * The mean density `normalizeDensity` divides by (default: unset, the source's `stats.meanNonZero`, which follows\n * `source.replace`). Set one value for a sequence so every frame has the same extinction scale: his sequences divide\n * by the mean of all frames' non-zero texels (`FrameVolume.getDensityScale`).\n */\n densityMean?: number | null;\n densityCutoff?: number;\n absorbance?: number;\n opacity?: number;\n emissiveIntensity?: number;\n /** Kelvin at emission values 0 and 1. */\n temperatureRange?: [number, number];\n offset3D?: THREE.Vector3Like;\n wrap3D?: THREE.Wrapping;\n /** Light types bitmask ({@link vdbFrameLights}); default all. */\n lights?: number;\n shadowSteps?: number;\n /** Sample the source's mip levels (default true; needs a source with a mip atlas). */\n mipmaps?: boolean;\n /** Emission colour hook (DIVERGES V24); default white. */\n emissionColor?: VDBVolumeNodesOptions[\"emissionColor\"];\n /**\n * HDDA empty-space skipping in the shadow march (sparse sources; K3.2). Skipped samples are exactly\n * 0, so the image does not change (within float noise); dense sources ignore it. Default false (D30: on the Apple GPU it\n * slowed the shadow march 1.07–3.31× in all 12 paired runs, +7 to +26 ms per frame; owner rule D29 was \"on\n * unless the cost is large\"). Timings in docs/archive/handoffs/K3-2a.md.\n */\n hdda?: boolean;\n}\n\nconst toBox = (bbox: VDBFrameVolumeProps[\"bbox\"], source: VDBThreeVolumeSource): THREE.Box3 => {\n if (bbox instanceof THREE.Box3) return bbox.clone();\n const b = bbox ?? (source.kind === \"dense\" ? source.volume.bbox : source.bbox);\n if (!b) return new THREE.Box3(new THREE.Vector3(-0.5, -0.5, -0.5), new THREE.Vector3(0.5, 0.5, 0.5));\n return new THREE.Box3(new THREE.Vector3(...b[0]), new THREE.Vector3(...b[1]));\n};\n\n/** FrameVolume.js L339–353: the volume box as a matrix of the unit box (into `target`). */\nconst boxMatrix = (box: THREE.Box3, target: THREE.Matrix4): THREE.Matrix4 => {\n const center = box.getCenter(new THREE.Vector3());\n const size = box.getSize(new THREE.Vector3()).max(new THREE.Vector3(1e-6, 1e-6, 1e-6));\n return target.compose(center, new THREE.Quaternion(), size);\n};\n\nexport class VDBFrameVolume extends THREE.Group {\n readonly isVDBFrameVolume = true as const;\n readonly source: VDBThreeVolumeSource;\n readonly sourceUniforms: VDBVolumeUniforms;\n readonly frameRenderer: VDBFrameRenderer;\n readonly proxy: THREE.Mesh<THREE.InstancedBufferGeometry>;\n readonly volumes: FrameVolumeRecord[];\n /** Built by the renderer on first use (the source is compiled into it). */\n injectMaterial: VDBFrameInjectMaterial | null = null;\n /** 'frame' lighting: the density and shadow density materials, built by the renderer on first use (K3.3). */\n densityMaterial: VDBFrameDensityMaterial | null = null;\n shadowDensityMaterial: VDBFrameShadowDensityMaterial | null = null;\n /** K3.6: the emission light's direction-pass material of this volume (made by the light on first use). */\n emissionDirectionMaterial: VDBFrameEmissionDirectionMaterial | null = null;\n readonly emissionColor: VDBVolumeNodesOptions[\"emissionColor\"];\n\n baseColor: THREE.Color;\n scatterColor: THREE.Color;\n extinction: number;\n extinctionScale: THREE.Vector3;\n angstromExponent: string | number;\n /** `'volume'` lighting: phase overrides (null: the renderer's `settings`); see {@link VDBFrameVolumeProps.phase}. */\n phase: VDBFramePhase | null;\n phaseG: number | null;\n phaseBackG: number | null;\n phaseBackWeight: number | null;\n phaseGExponent: number | null;\n densityScale: number;\n normalizeDensity: boolean;\n /** See {@link VDBFrameVolumeProps.densityMean}; null: the source's mean. */\n densityMean: number | null;\n densityCutoff: number;\n absorbance: number;\n opacity: number;\n emissiveIntensity: number;\n temperatureRange: THREE.Vector2;\n offset3D: THREE.Vector3;\n wrap3D: THREE.Wrapping;\n lights: number;\n shadowSteps: number;\n mipmaps: boolean;\n hdda: boolean;\n /**\n * The volume's box in its local space: the `bbox` prop, else the source's box, re-read\n * when the source's `version` moves: a dense frame with another `.wvdb` box (a sequence frame; RV, as his WVDB sequences)\n * or a sparse source made with `followImage` after its grid's image changed (G16a, e.g. a coarse-first\n * swap), so this object is updated in place then. Do not mutate.\n */\n readonly bbox: THREE.Box3;\n\n /** The medium fields at construction, for `setMedium(null)`. */\n private readonly initialMedium: { baseColor: THREE.Color; extinctionScale: THREE.Vector3; angstromExponent: string | number };\n /** `source.version` the uniforms were last updated for. */\n private sourceVersion: number;\n /** G16a / RV: the box is the source's (no `bbox` prop), so it follows the source. */\n private readonly boxFromSource: boolean;\n private readonly resolvedPhase: VDBFramePhaseSource = { phase: \"henyey-greenstein\", phaseG: 0.8, phaseBackG: -0.3, phaseBackWeight: 0.2, phaseGExponent: 0.0 };\n\n constructor(source: VDBThreeVolumeSource, props: VDBFrameVolumeProps = {}) {\n super();\n\n const ok = source && ((source.kind === \"dense\" && !!source.textures?.density) || (source.kind === \"sparse\" && typeof source.createNodes === \"function\"));\n if (!ok) {\n throw new VDBError(\"VDB_BAD_OPTION\", \"VDBFrameVolume: pass a volume source from vdbDenseTextures() or vdbSparseSource() (@pmndrs/vdb/three).\");\n }\n\n const {\n frameRenderer = vdbFrameRenderer(),\n bbox,\n baseColor = 0xffffff,\n scatterColor = 0x000000,\n extinction = 100.0,\n extinctionScale = [1.0, 1.0, 1.0],\n angstromExponent = \"cloud\",\n phase = null,\n phaseG = null,\n phaseBackG = null,\n phaseBackWeight = null,\n phaseGExponent = null,\n densityScale = 1.0,\n normalizeDensity = true,\n densityMean = null,\n densityCutoff = 0.0,\n absorbance = 1.0,\n opacity = 1.0,\n emissiveIntensity = 1.0,\n temperatureRange = [0.0, 6500.0],\n offset3D = new THREE.Vector3(),\n wrap3D = THREE.ClampToEdgeWrapping,\n lights = vdbFrameAllLights,\n shadowSteps = 32,\n mipmaps = true,\n emissionColor,\n hdda = false,\n } = props;\n\n this.source = source;\n this.frameRenderer = frameRenderer;\n this.emissionColor = emissionColor;\n this.baseColor = new THREE.Color(baseColor);\n this.scatterColor = new THREE.Color(scatterColor);\n this.extinction = extinction;\n this.extinctionScale = Array.isArray(extinctionScale) ? new THREE.Vector3().fromArray(extinctionScale) : new THREE.Vector3().copy(extinctionScale);\n this.angstromExponent = angstromExponent;\n this.phase = phase;\n this.phaseG = phaseG;\n this.phaseBackG = phaseBackG;\n this.phaseBackWeight = phaseBackWeight;\n this.phaseGExponent = phaseGExponent;\n this.densityScale = densityScale;\n this.normalizeDensity = normalizeDensity;\n this.densityMean = densityMean;\n this.densityCutoff = densityCutoff;\n this.absorbance = absorbance;\n this.opacity = opacity;\n this.emissiveIntensity = emissiveIntensity;\n this.temperatureRange = new THREE.Vector2().fromArray(temperatureRange);\n this.offset3D = new THREE.Vector3().copy(offset3D);\n this.wrap3D = wrap3D;\n this.lights = lights;\n this.shadowSteps = shadowSteps;\n this.mipmaps = mipmaps;\n this.hdda = hdda;\n this.initialMedium = { baseColor: this.baseColor.clone(), extinctionScale: this.extinctionScale.clone(), angstromExponent };\n\n this.sourceUniforms = vdbVolumeUniforms(source, { extinction, densityScale, normalizeDensity });\n this.sourceVersion = source.version;\n\n this.proxy = new THREE.Mesh(frameRenderer.createProxyGeometry(), frameRenderer.integrateMaterial);\n this.proxy.frustumCulled = false;\n this.proxy.renderOrder = frameRenderOrder;\n this.proxy.onBeforeRender = (renderer, scene, camera) => {\n frameRenderer.render(renderer as never, scene, camera, this.proxy);\n };\n this.add(this.proxy);\n\n // FrameVolume.js L339–353: the volume box as a matrix of the unit box.\n const box = toBox(bbox, source);\n this.bbox = box;\n this.boxFromSource = bbox === undefined;\n\n this.volumes = [\n {\n matrix: boxMatrix(box, new THREE.Matrix4()),\n matrixWorld: new THREE.Matrix4(),\n localToView: new THREE.Matrix4(),\n viewToLocal: new THREE.Matrix4(),\n worldToLocal: new THREE.Matrix4(),\n worldBox: new THREE.Box3(),\n viewNear: 0.0,\n viewFar: 0.0,\n ready: true,\n },\n ];\n }\n\n /** The mean density `normalizeDensity` divides by: `densityMean` when set, else the source's mean of the non-zero texels (his `meanDensity`). */\n get meanDensity(): number {\n return this.densityMean ?? this.source.stats.meanNonZero;\n }\n\n /** The phase this volume is drawn with in `'volume'` lighting: its own `phase*` fields where set, else the renderer's `settings` (a reused object). */\n getPhase(): Readonly<VDBFramePhaseSource> {\n const s = this.frameRenderer.settings;\n const p = this.resolvedPhase;\n p.phase = this.phase ?? s.phase;\n p.phaseG = this.phaseG ?? s.phaseG;\n p.phaseBackG = this.phaseBackG ?? s.phaseBackG;\n p.phaseBackWeight = this.phaseBackWeight ?? s.phaseBackWeight;\n p.phaseGExponent = this.phaseGExponent ?? s.phaseGExponent;\n return p;\n }\n\n /**\n * A measured medium in one call (`'cloud'`, `'fog'`, `'ice'`, `'soot'`, `'white-smoke'`, `'dark-smoke'`, `'haze'`,\n * `'dust'`, or {@link VDBFrameMediumVolumeProps} from `vdbFrameMedium`), as his GUI's 'Medium' field: the volume's\n * `baseColor`, `extinctionScale` and `angstromExponent`; the phase on the renderer (`frameRenderer.settings.phase`,\n * `phaseG`, `phaseGExponent`: the phase of 'frame' lighting and the default of 'volume' lighting; the volume's own\n * phase overrides are cleared) and `settings.spectral` on. The renderer's settings are shared by every volume it\n * draws. `null` restores the volume's constructor colour, extinction scale and Ångström exponent (the renderer is left\n * as it is). Returns the props applied (null for `null`); an unknown name throws `VDB_BAD_OPTION`.\n */\n setMedium(medium: string | VDBFrameMediumVolumeProps | null): VDBFrameMediumVolumeProps | null {\n if (medium === null) {\n this.baseColor.copy(this.initialMedium.baseColor);\n this.extinctionScale.copy(this.initialMedium.extinctionScale);\n this.angstromExponent = this.initialMedium.angstromExponent;\n return null;\n }\n const props = typeof medium === \"string\" ? getFrameMediumProps(medium) : medium;\n if (!props) throw new VDBError(\"VDB_BAD_OPTION\", `VDBFrameVolume.setMedium: unknown medium ${JSON.stringify(medium)}; use one of vdbFrameMediumNames (@pmndrs/vdb/tools).`);\n this.baseColor.copy(props.baseColor);\n this.extinctionScale.copy(props.extinctionScale);\n this.angstromExponent = props.angstromExponent;\n this.phase = this.phaseG = this.phaseBackG = this.phaseBackWeight = this.phaseGExponent = null;\n const s = this.frameRenderer.settings;\n s.phase = props.phase;\n s.phaseG = props.phaseG;\n s.phaseGExponent = props.phaseGExponent;\n s.spectral = true;\n return props;\n }\n\n /** densityScale for the shaders. normalizeDensity divides it by the mean density. */\n getDensityScale(): number {\n const meanDensity = this.meanDensity;\n\n return this.normalizeDensity && meanDensity > 0.0 ? this.densityScale / meanDensity : this.densityScale;\n }\n\n /**\n * Re-read the source (textures, sizes, LOD levels). The renderer calls {@link VDBFrameVolume.syncSource} before\n * every draw, so a `source.replace()` needs no call; this forces it.\n */\n updateSource(): void {\n this.sourceVersion = this.source.version;\n this.sourceUniforms.update(this.source, { densityScale: this.densityScale, normalizeDensity: this.normalizeDensity });\n // G16a: a sparse source's box (a followImage source re-reads it after an image change). RV: a dense frame's\n // .wvdb box (his WVDB sequences give every frame its own box; a null box, an empty frame, keeps the last one).\n const sourceBox = this.source.kind === \"sparse\" ? this.source.bbox : this.source.volume.bbox;\n if (this.boxFromSource && sourceBox) {\n const [min, max] = sourceBox;\n const b = this.bbox;\n if (b.min.x !== min[0] || b.min.y !== min[1] || b.min.z !== min[2] || b.max.x !== max[0] || b.max.y !== max[1] || b.max.z !== max[2]) {\n b.min.set(...min);\n b.max.set(...max);\n for (const volume of this.volumes) boxMatrix(b, volume.matrix);\n }\n }\n }\n\n /** {@link VDBFrameVolume.updateSource} if the source changed since (its `version`: a resized dense frame, a replaced pool image). Cheap; called per draw. */\n syncSource(): void {\n if (this.source.version !== this.sourceVersion) this.updateSource();\n }\n\n /** Frees the proxy geometry and the pass materials, and stops following the source (its uniforms). The source belongs to the caller. */\n dispose(): void {\n this.sourceUniforms.dispose();\n this.injectMaterial?.dispose();\n this.injectMaterial = null;\n this.densityMaterial?.dispose();\n this.densityMaterial = null;\n this.shadowDensityMaterial?.dispose();\n this.shadowDensityMaterial = null;\n this.emissionDirectionMaterial?.dispose();\n this.emissionDirectionMaterial = null;\n this.proxy.geometry.dispose();\n }\n}\n"]}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `VDBGridNode`: a `VDBGridPool` inside three's node system (task K2.2,
|
|
3
|
+
* docs/dev/design/K1-core.md §6). Follows `@pmndrs/bvh`'s `src/three/trace-nodes.ts`.
|
|
4
|
+
*
|
|
5
|
+
* const grids = new VDBGridNode(renderer, pool, { profile: 'sample' });
|
|
6
|
+
* // TSL:
|
|
7
|
+
* const density = vdbSample(grids, gridId, positionWorld);
|
|
8
|
+
* // or WGSL, calling the generated module by name (one module per shader):
|
|
9
|
+
* const shade = wgslFn(`fn shade(g: u32, p: vec3f) -> f32 {
|
|
10
|
+
* var a = vdbAccessorInit(g);
|
|
11
|
+
* return vdbSample(&a, vdbWorldToIndex(g, p));
|
|
12
|
+
* }`, [grids.module]);
|
|
13
|
+
* // each frame, after pool.update(encoder) was submitted (or pool.flush()):
|
|
14
|
+
* grids.update();
|
|
15
|
+
*
|
|
16
|
+
* **Binding.** `grids.storage` is a read-only three storage node named
|
|
17
|
+
* `vdbPool` (`storage(standIn, 'uint', 0).toReadOnly().setName('vdbPool')`).
|
|
18
|
+
* Its `StorageBufferAttribute` is a stand-in: before three first sees it, the
|
|
19
|
+
* backend's record for it gets `buffer = pool.buffer`, and three's
|
|
20
|
+
* `createAttribute` only makes a buffer when that field is unset. So three
|
|
21
|
+
* binds the pool's buffer as is: no copy, no CPU write, one binding (D10).
|
|
22
|
+
* three emits `struct vdbPoolStruct { value: array<u32> }` at a group and
|
|
23
|
+
* binding it chooses; the module reads it through the storage node's property
|
|
24
|
+
* reference (`vdbPool.value`), its one access site (the generator's `buffer`
|
|
25
|
+
* mode). The name is fixed, so shader text is the same on every load.
|
|
26
|
+
*
|
|
27
|
+
* **Module.** `grids.module` is a `CodeNode` holding the storage node as a node
|
|
28
|
+
* property, so three sets it up as a child and emits its binding in any shader
|
|
29
|
+
* that includes the module. Its WGSL is `vdbModuleWgsl({ ...options, buffer:
|
|
30
|
+
* <the storage node's property reference> })`, memoized per reference.
|
|
31
|
+
* `wgslFn` parses only its first `fn`; every helper lives in this module.
|
|
32
|
+
*
|
|
33
|
+
* **Rebinding.** `update()` compares `pool.version` (and the buffer object). When
|
|
34
|
+
* the pool replaced its buffer (growth, compaction, rollback), the storage
|
|
35
|
+
* node's value becomes a new stand-in bound to the new buffer and three makes
|
|
36
|
+
* new bind groups at the next use. Nothing recompiles. `pool.revision` changes
|
|
37
|
+
* (add, replace, remove, setTransform into the same buffer) need nothing.
|
|
38
|
+
* Skipping `update()` after a growth leaves three binding the old buffer, which
|
|
39
|
+
* the pool destroys a couple of updates later.
|
|
40
|
+
*
|
|
41
|
+
* **Disposal.** The pool owns its buffer. three tracks the stand-ins like its own
|
|
42
|
+
* attributes, so `renderer.dispose()` or a stand-in's `dispose()` would destroy
|
|
43
|
+
* the pool's buffer. `backend.destroyAttribute` is wrapped once per backend:
|
|
44
|
+
* for a stand-in, a throwaway buffer takes the pool's place before three
|
|
45
|
+
* destroys it. (A renderer that created its own device still destroys that
|
|
46
|
+
* device in `renderer.dispose()`; see `device.ts`.)
|
|
47
|
+
*
|
|
48
|
+
* **One renderer, one module per shader.** A `VDBGridNode` binds through one
|
|
49
|
+
* renderer's backend: build a second node for a second renderer (even on the
|
|
50
|
+
* same device). A shader holds at most one VDB module, so every grid one
|
|
51
|
+
* shader reads goes through one `VDBGridNode`. Both are checked when three
|
|
52
|
+
* builds a shader (`VDB_BAD_OPTION`).
|
|
53
|
+
*
|
|
54
|
+
* This file reaches into three's WebGPU backend, which is not public API. It
|
|
55
|
+
* is written against three r187 (peer range >=0.187.0 <0.188.0, D23), and
|
|
56
|
+
* every internal it uses is listed in `threeInternals` and checked loudly:
|
|
57
|
+
* another three revision warns once, and the first `VDBGridNode` on a backend
|
|
58
|
+
* runs a self-test of the disposal path before any pool buffer reaches three
|
|
59
|
+
* (`VDB_ENGINE_MISMATCH` if three would destroy a buffer behind the guard).
|
|
60
|
+
*/
|
|
61
|
+
import { type Node, type NodeBuilder } from "three/webgpu";
|
|
62
|
+
import type { VDBModuleHelper, VDBModuleOptions, VDBModuleProfile } from "../core/wgsl/types.js";
|
|
63
|
+
import type { VDBGridTypeName } from "../core/types.js";
|
|
64
|
+
import { type VDBThreeRendererLike } from "./device.js";
|
|
65
|
+
/** What `VDBGridNode` needs from a pool; a `VDBGridPool` is one. */
|
|
66
|
+
export interface VDBGridNodePoolLike {
|
|
67
|
+
readonly device: GPUDevice;
|
|
68
|
+
/** Replaced only when `version` changes. */
|
|
69
|
+
readonly buffer: GPUBuffer;
|
|
70
|
+
readonly version: number;
|
|
71
|
+
readonly layoutVersion: number;
|
|
72
|
+
readonly types: Iterable<VDBGridTypeName>;
|
|
73
|
+
}
|
|
74
|
+
/** Options of {@link VDBGridNode}: the module options, minus the binding (the adapter owns it). */
|
|
75
|
+
export interface VDBGridNodeOptions {
|
|
76
|
+
/** Grid types the module decodes; others read 0. Default: the pool's types now (`[...pool.types]`, checked). */
|
|
77
|
+
readonly types?: Iterable<VDBGridTypeName> | undefined;
|
|
78
|
+
/** `'read'`, `'sample'` (default) or `'march'`. `vdbSample` needs `sample`+. */
|
|
79
|
+
readonly profile?: Exclude<VDBModuleProfile, "majorant"> | undefined;
|
|
80
|
+
readonly sampler?: VDBModuleOptions["sampler"];
|
|
81
|
+
readonly isActive?: VDBModuleOptions["isActive"];
|
|
82
|
+
readonly outside?: VDBModuleOptions["outside"];
|
|
83
|
+
/**
|
|
84
|
+
* Opt-in WGSL helpers for the module (`'rayClipSupport'`, and with `march`
|
|
85
|
+
* `'cellBoundTrilinear'`, `'hddaCellEnd'`). `VDBVolumeMaterial` needs
|
|
86
|
+
* `'rayClipSupport'`. Default none.
|
|
87
|
+
*/
|
|
88
|
+
readonly helpers?: Iterable<VDBModuleHelper> | undefined;
|
|
89
|
+
/** Name of the storage binding three emits. Default `'vdbPool'`. */
|
|
90
|
+
readonly name?: string | undefined;
|
|
91
|
+
}
|
|
92
|
+
/** A three storage node, as far as this file uses one. */
|
|
93
|
+
type StorageNode = Node & {
|
|
94
|
+
value: unknown;
|
|
95
|
+
setName(name: string): unknown;
|
|
96
|
+
build(builder: NodeBuilder, output?: string): unknown;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* A TSL node, loosely typed: three's TSL types do not follow a value returned
|
|
100
|
+
* through a `wgslFn`, so the helpers take and return this (as `@pmndrs/bvh` does).
|
|
101
|
+
*/
|
|
102
|
+
export type VDBTslNode = any;
|
|
103
|
+
/** The three revision this adapter is written against. */
|
|
104
|
+
export declare const VDB_THREE_REVISION = "187";
|
|
105
|
+
/** Label of the self-test buffer (4 bytes, once per backend). */
|
|
106
|
+
export declare const VDB_THREE_SELF_TEST_LABEL = "@pmndrs/vdb/three self-test";
|
|
107
|
+
/**
|
|
108
|
+
* @internal Warns once per page when `revision` is not the three revision this
|
|
109
|
+
* adapter is written against. Returns true when it warned.
|
|
110
|
+
*/
|
|
111
|
+
export declare function warnThreeRevision(revision: string): boolean;
|
|
112
|
+
/** @internal Resets the once-per-page revision warning (tests). */
|
|
113
|
+
export declare function resetThreeRevisionWarning(): void;
|
|
114
|
+
/** Module options after validation, without the binding. */
|
|
115
|
+
type ModuleOptions = Omit<VDBModuleOptions, "slot" | "buffer" | "helpers"> & {
|
|
116
|
+
readonly types: readonly VDBGridTypeName[];
|
|
117
|
+
readonly profile: VDBModuleProfile;
|
|
118
|
+
readonly helpers?: readonly VDBModuleHelper[];
|
|
119
|
+
};
|
|
120
|
+
type HelperKind = "sampleWorld" | "sampleIndex" | "readValue";
|
|
121
|
+
/**
|
|
122
|
+
* A `VDBGridPool` in three's node system; see the file comment. Not itself a
|
|
123
|
+
* three node: it holds the storage node (`storage`), the module code node
|
|
124
|
+
* (`module`) and the TSL helpers' functions.
|
|
125
|
+
*/
|
|
126
|
+
export declare class VDBGridNode {
|
|
127
|
+
readonly pool: VDBGridNodePoolLike;
|
|
128
|
+
/** The pool's buffer as a read-only three storage node (`array<u32>`). */
|
|
129
|
+
readonly storage: StorageNode;
|
|
130
|
+
/** The generated WGSL module (`vdbAccessorInit`, `vdbSample`, ...) as a three code node: include it in a `wgslFn`. */
|
|
131
|
+
readonly module: Node;
|
|
132
|
+
/** The module options this node compiles (validated; `types` sorted). */
|
|
133
|
+
readonly options: Readonly<ModuleOptions>;
|
|
134
|
+
/** Name of the storage binding three emits. */
|
|
135
|
+
readonly name: string;
|
|
136
|
+
/**
|
|
137
|
+
* The renderer this node binds through. Only shaders this renderer builds
|
|
138
|
+
* may use the node; make one `VDBGridNode` per renderer.
|
|
139
|
+
*/
|
|
140
|
+
readonly renderer: VDBThreeRendererLike;
|
|
141
|
+
private readonly three;
|
|
142
|
+
private boundVersion;
|
|
143
|
+
private bound;
|
|
144
|
+
private disposed;
|
|
145
|
+
private readonly verified;
|
|
146
|
+
private readonly helpers;
|
|
147
|
+
constructor(renderer: VDBThreeRendererLike, pool: VDBGridNodePoolLike, options?: VDBGridNodeOptions);
|
|
148
|
+
/** The pool version bound now (the pool's at construction or the last {@link update} that rebound). */
|
|
149
|
+
get version(): number;
|
|
150
|
+
/**
|
|
151
|
+
* Rebinds the storage node when the pool replaced its buffer (`version`
|
|
152
|
+
* changed, or the buffer object differs). Returns true when it rebound.
|
|
153
|
+
* Cheap when nothing changed; call it every frame before three renders or
|
|
154
|
+
* computes with this node.
|
|
155
|
+
*
|
|
156
|
+
* @throws VDBError `VDB_ENGINE_MISMATCH` when three bound something other
|
|
157
|
+
* than the pool's buffer to a stand-in it used (a three whose internals
|
|
158
|
+
* differ; see `threeInternals`); `VDB_DISPOSED` after {@link dispose}.
|
|
159
|
+
*/
|
|
160
|
+
update(): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Checks that this module can read every grid the pool holds now.
|
|
163
|
+
*
|
|
164
|
+
* @throws VDBError `VDB_TYPE_NOT_COMPILED` (those grids would read 0) or `VDB_LAYOUT_MISMATCH`.
|
|
165
|
+
*/
|
|
166
|
+
check(): void;
|
|
167
|
+
/** Releases the stand-in attribute. The pool's buffer is not destroyed (it is the pool's). */
|
|
168
|
+
dispose(): void;
|
|
169
|
+
/** @internal The `wgslFn` behind a TSL helper, made once per node (the module is included once per shader). */
|
|
170
|
+
helper(kind: HelperKind): (...args: unknown[]) => VDBTslNode;
|
|
171
|
+
/** The stand-in three used still has the pool's buffer, and three made none of its own. */
|
|
172
|
+
private checkBinding;
|
|
173
|
+
/** A `StorageBufferAttribute` whose GPU buffer is `buffer`: three takes it as made, never creates one, never destroys it. */
|
|
174
|
+
private standIn;
|
|
175
|
+
/** Lets three forget an attribute: the destroy guard swaps a throwaway in for the pool's buffer, which three then destroys. */
|
|
176
|
+
private retire;
|
|
177
|
+
}
|
|
178
|
+
/** Options of {@link vdbSample}. */
|
|
179
|
+
export interface VDBSampleOptions {
|
|
180
|
+
/** `'world'` (default): `position` is world space, through the grid's record transform (`setTransform`). `'index'`: index space. */
|
|
181
|
+
readonly space?: "world" | "index" | undefined;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* TSL: the grid's value at `position` (a `vec3` node) with the node's sampler
|
|
185
|
+
* (`trilinear` or `nearest`) and `outside` mode. `gridIndex` is a `uint` node
|
|
186
|
+
* or a number (the id `pool.add` returned). Needs profile `sample` or `march`.
|
|
187
|
+
* A dead id, or a grid type the module does not compile, reads 0.
|
|
188
|
+
*/
|
|
189
|
+
export declare function vdbSample(grids: VDBGridNode, gridIndex: VDBTslNode | number, position: VDBTslNode, options?: VDBSampleOptions): VDBTslNode;
|
|
190
|
+
/**
|
|
191
|
+
* TSL: the grid's value at index coordinate `ijk` (an `ivec3` node; a float
|
|
192
|
+
* vector converts by truncation). Any profile. A dead id, or a grid type the
|
|
193
|
+
* module does not compile, reads 0.
|
|
194
|
+
*/
|
|
195
|
+
export declare function vdbReadValue(grids: VDBGridNode, gridIndex: VDBTslNode | number, ijk: VDBTslNode): VDBTslNode;
|
|
196
|
+
export {};
|