@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":"renderer.js","sourceRoot":"","sources":["../../../src/three/frame/renderer.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qGAAqG;AACrG,gGAAgG;AAChG,8FAA8F;AAC9F,wFAAwF;AACxF,wFAAwF;AACxF,8FAA8F;AAC9F,yFAAyF;AACzF,6FAA6F;AAC7F,6FAA6F;AAC7F,8DAA8D;AAC9D,sFAAsF;AACtF,yGAAyG;AACzG,mGAAmG;AACnG,2GAA2G;AAC3G,0GAA0G;AAC1G,yFAAyF;AACzF,yGAAyG;AACzG,yGAAyG;AACzG,4GAA4G;AAC5G,uGAAuG;AACvG,+GAA+G;AAC/G,oGAAoG;AACpG,sCAAsC;AACtC,kHAAkH;AAClH,qGAAqG;AACrG,2GAA2G;AAC3G,4GAA4G;AAC5G,8FAA8F;AAC9F,kGAAkG;AAClG,kGAAkG;AAClG,wEAAwE;AACxE,oCAAoC;AAEpC;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;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AC,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC;IACpC,kHAAkH;IAClH,8DAA8D;IAC9D,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IACrC,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACzC,qBAAqB,CAAC,KAAK,EAAE,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED,0EAA0E;AAC1E,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA4B,CAAC;AACjE,IAAI,MAAM,GAA4B,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAiB;IAChD,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,CAAC;YAAE,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACrE,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,KAAK,IAAI,gBAAgB,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/FrameRenderer.js L79–135 (caster signatures, fullscreen geometry,\n// targets, scenes), L144–174 (getClipRect, getMaxTextureSize), L191–246 (settings, the ported\n// subset), L249–430 (fields, constructor), L431–481 (render, createProxyGeometry), L493–570\n// (isFrameLighting, renderEnvironmentGrid), L572–596 (renderEnvironmentMap), L598–645\n// (collectVolumes, usesShadowGrid, isNeural), L715–895 (getSliceRange, updateTargets,\n// updateGridTargets), L897–1005 (renderFrame, updateFroxelArea, renderTemporal), L1007–1061\n// (copyEnvironment, prepareLightScene, renderInject), L1063–1308 (renderFrameLighting,\n// transmittanceUnchanged, renderShadowDensity, updateGridVersion), L1347–1474 (pool setup,\n// updatePool, getFroxelRect, getCascadeCount, updateGrid, getGridRange), L1476–1716 (light\n// records, visitLight, updateLights), L1718–1784 (dispose);\n// src/three-openvdb/frame/webgpu/frameShaderChunks.js L800–830 (setVolumeUniforms);\n// K3.4: FrameRenderer.js L232–242 (multipleScattering 'neural' default, octave settings), L291–296 and\n// L642–699 (isNeural, the grid mip targets, renderGridMips), L1052–1056 and L1086–1098 (octaves,\n// two-sided and neural uniforms of the inject and transmittance passes), L1132 and L1201 (octaves of the\n// density and lighting passes), L506–518 and L559 (octaves in the environment grid signature and pass),\n// L1213–1226 (the neural, two-sided and octave fields of the transmittance signature);\n// K3.5: L176–189 (createAtlasTarget, isSpectralTarget), L335–337 (the spectral transmittance targets),\n// L514 and L556 (spectral in the environment grid signature and pass), L638–640 (isSpectral), L702–713\n// (getSpectralTransmittanceTarget), L725–866 (the spectral targets of updateTargets / updateGridTargets),\n// L908 (environment lights in both lighting modes), L973–1003 (the alpha targets of renderTemporal),\n// L1030 (the inject pass reads the scene environment), L1079–1196 (the slot group loop and the spectral maps\n// of renderFrameLighting), L1210–1231 (the spectral fields of the transmittance signature), L1303\n// (spectral in the grid signature);\n// K3.6: L218–230 (the castShadow* settings), L269 and L456 (volumeShadows, updated before each frame), L340–350\n// (gridRenderId / gridCamera, castVersion), L634–636 (usesShadowGrid with castShadows), L1250–1290\n// (renderShadowDensity onlyLast), L1310–1345 (prepareShadowGrid), L1719 (dispose of the volume shadows).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: TypeScript; one inject, density and shadow density material per volume source (the\n// source is compiled into each; DIVERGES V30); mesh shadows (K3.6, volume-shadows.ts); the neural\n// network is a settable value (`neuralNetwork`; null: diffusion, with a warning); per-pass timing\n// hooks and a redraw-skip counter. Divergences: DIVERGES.md (K3.1, K3.3\n// and K3.4 rows), V23–V25, V30–V34.\n\n/**\n * The froxel renderer (K3.1 `'volume'` lighting, K3.3 `'frame'` lighting; R1 §2). Each\n * `VDBFrameVolume` proxy calls {@link VDBFrameRenderer.render} from `onBeforeRender`; the first\n * proxy in a render draws the froxels into a slice atlas, and every proxy then draws the integrate\n * material, which composites the atlas over the scene up to the scene depth.\n *\n * `'frame'` lighting: shadow density of every caster into a world grid (≤ 4 cascades, redrawn only\n * when its signature changes), transmittance from each grid voxel to ≤ 6 light slots and the sky,\n * an optional environment grid ('directional' / 'spherical-harmonics' environment lights from a\n * PMREM readback), the density pass per volume, one lighting pass for all volumes, then temporal\n * reprojection.\n */\n\nimport * as THREE from \"three\";\nimport type { WebGPURenderer } from \"three/webgpu\";\nimport { NodeMaterial } from \"three/webgpu\";\nimport * as TSL from \"three/tsl\";\nimport type { VDBTslNode } from \"../grid-node.js\";\nimport { VDBFrameEnvironmentLights, frameEnvironmentMapHeight, frameEnvironmentMapWidth, frameEnvironmentModes, type VDBFrameEnvironmentResult } from \"../../tools/frame/environment.js\";\nimport {\n vdbFrameCascadeCasters,\n vdbFrameGridCascades,\n vdbFrameGridRange,\n vdbFrameGridSignatureState,\n vdbFrameUpdateGridSignatures,\n vdbSameValues,\n vdbSignaturePushElements,\n vdbSignaturePushVector,\n type VDBFrameGridSignatureState,\n} from \"../../tools/frame/grid.js\";\nimport {\n createAreaUniforms,\n createEnvironmentGridUniforms,\n createFroxelUniforms,\n createGridUniforms,\n createLightUniforms,\n createTileUniforms,\n frameMaxHemisphereLights,\n frameMaxLights,\n frameMaxShadowCascades,\n frameTileVertex,\n type FrameVolumeUniforms,\n} from \"./chunks.js\";\nimport { VDBFrameDensityMaterial, createDensityShadowUniforms, frameDensityEnvironment } from \"./density-material.js\";\nimport { VDBFrameEnvironmentMapMaterial } from \"./environment-material.js\";\nimport { VDBFrameEnvironmentGridMaterial } from \"./environment-grid-material.js\";\nimport { VDBFrameInjectMaterial } from \"./inject-material.js\";\nimport { VDBFrameIntegrateMaterial } from \"./integrate-material.js\";\nimport { getAtlasLayout, getFroxelSize } from \"./layout.js\";\nimport { VDBFrameLightingMaterial } from \"./lighting-material.js\";\nimport { getFramePhase, getFramePhaseSpectrum, getFrameMultipleScattering, getFrameScatteringOctaves, getFrameTwoSidedDiffusion, isFrameDiffusion, type VDBFrameMultipleScattering, type VDBFramePhase } from \"./phase.js\";\nimport { VDBFrameGridMipMaterial } from \"./grid-mip-material.js\";\nimport { vdbFrameNeuralCheck, type VDBFrameNeuralNetwork } from \"../../tools/frame/neural.js\";\nimport { vdbFrameNeuralWeights } from \"../../tools/frame/neural-weights.js\";\nimport { VDBFrameShadowDensityMaterial } from \"./shadow-density-material.js\";\nimport { getFrameExtinctionSpectrum, getFrameSpectralGroups } from \"./spectrum.js\";\nimport { VDBFrameTemporalMaterial } from \"./temporal-material.js\";\nimport { VDBFrameTransmittanceMaterial, frameNeuralMipLevels, frameShadowLightSlots } from \"./transmittance-material.js\";\nimport { VDBFrameVolumeShadows } from \"./volume-shadows.js\";\nimport { FrameVolumeCollector, getFrameFadeRadius, getFroxelArea, getFroxelRect, getFroxelSliceRange, type FrameVolumeEntry, type FrameVolumeRecord } from \"./view.js\";\nimport type { VDBFrameVolume } from \"./volume.js\";\nimport type { VDBVolumeUniforms } from \"../volume-source.js\";\n\nconst { outputStruct, vec4 } = TSL as unknown as Record<string, VDBTslNode>;\n\n/** Renderer settings: his `frameRenderer.settings`, the subset ported in K3.1–K3.3 (same names and meanings). */\nexport interface VDBFrameRendererSettings {\n /** Froxel grid width (default 512). */\n width: number;\n /** Froxel grid height (default 512). */\n height: number;\n /** N > 0: at most one froxel per N x N canvas (CSS) pixels. 0: no cap. */\n pixelsPerFroxel: number;\n /** Slices (default 24). */\n depth: number;\n /** Most sub-steps across one slice (default 32). */\n subSteps: number;\n near: number;\n far: number;\n /** View distance where the density fades to 0 (FogExp2-like). Infinity: no fade. */\n fadeRadius: number;\n /** Golden-ratio jitter of the sub-steps, shadow start and grid marches (default false). */\n jitter: boolean;\n /** His froxel reprojection with a neighbourhood clamp (default true, his; K3.4 flipped it with `lighting` and `multipleScattering`, V33). */\n temporal: boolean;\n /** History weight of the temporal pass (0.01–1; his default 0.2). */\n temporalBlend: number;\n /** `'volume'`: each volume lights itself with its own shadow march. `'frame'`: the world shadow grid (default, his; since K3.4, V33). */\n lighting: \"volume\" | \"frame\";\n /** `'frame'` lighting: voxels on each side of each shadow grid cascade (default 64). */\n shadowResolution: number;\n /** `'frame'` lighting: shadow grid cascades, 1–4 (default 1). */\n shadowCascades: number;\n /** `'frame'` lighting: half size of the finest cascades around the camera (default 512). */\n shadowDistance: number;\n /**\n * The phase of every volume this renderer draws (default 'henyey-greenstein', g 0.8; his demos set 'dual-lobe'), and\n * of `phaseG` … `phaseGExponent`: `'frame'` lighting lights all volumes with it in one pass; in `'volume'` lighting\n * a volume's own `phase*` props override it where set (K5.9: one place to set the phase; his 'volume' lighting\n * read only the volume's).\n */\n phase: VDBFramePhase;\n phaseG: number;\n phaseBackG: number;\n phaseBackWeight: number;\n phaseGExponent: number;\n /** Blend the volumes over the scene in sRGB, as WebGLRenderer. false blends in linear space. */\n srgbBlending: boolean;\n /**\n * `'frame'` lighting: the scene environment as lights: `'outward'` (PMREM irradiance along each\n * volume's outward direction), `'directional'` (≤ 8 lights from a 64 × 32 readback, default) or\n * `'spherical-harmonics'` (SH quadrature lights).\n */\n environmentLighting: \"outward\" | \"directional\" | \"spherical-harmonics\";\n /** Lights of `'directional'` (1–8, default 8). */\n environmentSamples: number;\n /** SH order of `'spherical-harmonics'` (1 or 2, default 1). */\n environmentShOrder: number;\n /**\n * Multiple scattering in the shadow marches: false (single scattering), true (1D diffusion toward the\n * light), `'two-sided'` (2D slab diffusion toward and away from the light), `'octaves'` (indirect light\n * octaves, `scatteringOctave*`) or `'neural'` (default, his: the scattered light of the scene light\n * slots from a small network in `'frame'` lighting, diffusion elsewhere; `neuralNetwork`).\n */\n multipleScattering: VDBFrameMultipleScattering;\n /** `'octaves'`: octaves N (1–8, default 4). Octave n has extinction × aⁿ, light × bⁿ, phase g × cⁿ. */\n scatteringOctaves: number;\n /** `'octaves'`: a (0–1, default 0.5). */\n scatteringOctaveExtinction: number;\n /** `'octaves'`: b (0–1, default 0.5). */\n scatteringOctaveContribution: number;\n /** `'octaves'`: c (0–1, default 0.5). */\n scatteringOctavePhase: number;\n /**\n * Spectral media (K3.5, his `spectral`, default false): per-channel extinction (each volume's\n * `extinctionScale` × (λ / 550)^−`angstromExponent`), per-channel albedo and multiple scattering. 'frame'\n * lighting draws one transmittance pass per slot group (3 targets each); the froxel atlas gets a second\n * target. `'neural'` runs as 1D diffusion (his `isNeural`). See `getFrameMediumProps` for measured media.\n */\n spectral: boolean;\n /**\n * K3.6 (his `castShadows`, default false): volumes cast shadows on meshes, for directional, point and spot lights\n * with `castShadow` (and `renderer.shadowMap.enabled`; receivers need `receiveShadow`). Beer shadow maps from the\n * world shadow grid's last cascade, multiplied into each light's shadow (`volume-shadows.ts`). Uses three r187\n * internals, self-tested (VDB_ENGINE_MISMATCH on another three).\n */\n castShadows: boolean;\n /** Texels on each side of a volume shadow map (each cascade tile and cube face; default 512). */\n castShadowMapSize: number;\n /** Directional lights: cascades of the volume shadow map (1–4, default 1). */\n castShadowCascades: number;\n /** Directional lights: the largest view distance the cascades cover (default 4000). */\n castShadowDistance: number;\n /** Grid samples on each light ray of a volume shadow map (1–256, default 32). */\n castShadowSteps: number;\n /** Map pieces drawn again in one render (a cascade tile or spot map 1, a cube map 6; default 1). */\n castShadowUpdatesPerFrame: number;\n /** Very small maps (64) and few samples (8): soft blob shadows at almost no cost (default false). */\n castShadowCoarse: boolean;\n}\n\n/** Per-pass hook (D25: timings are provisional). */\nexport type VDBFramePass = \"froxels\" | \"inject\" | \"shadowDensity\" | \"gridMips\" | \"transmittance\" | \"environmentGrid\" | \"density\" | \"lighting\" | \"temporal\" | \"volumeShadows\" | \"emissionProbes\";\n\nexport interface VDBFramePassHook {\n begin?(pass: VDBFramePass, detail?: { volume: VDBFrameVolume }): void;\n end?(pass: VDBFramePass, detail?: { volume: VDBFrameVolume }): void;\n}\n\n/** Redraw counters of the signature-cached `'frame'` passes (drawn / skipped renders). Not his. */\nexport interface VDBFrameRedrawStats {\n shadowDensity: { drawn: number; skipped: number };\n transmittance: { drawn: number; skipped: number };\n environmentGrid: { drawn: number; skipped: number };\n}\n\nconst clearColor = new THREE.Color();\nconst vector3 = new THREE.Vector3();\nconst froxelSize = { width: 1, height: 1 };\nconst lightPosition = new THREE.Vector3();\nconst lightTarget = new THREE.Vector3();\nconst lightColor = new THREE.Color();\nconst cameraPosition = new THREE.Vector3();\nconst extinctionSpectrum = new THREE.Vector3();\n\n// NOTE Instanced, then frame volume proxies skip the draw with instanceCount 0 (three.js does not draw 0 instances)\nexport const createFullscreenGeometry = () => {\n const geometry = new THREE.InstancedBufferGeometry();\n geometry.instanceCount = 1;\n geometry.setAttribute(\"position\", new THREE.Float32BufferAttribute([-1, -1, 0, 3, -1, 0, -1, 3, 0], 3));\n\n return geometry;\n};\n\nconst tileQuadPosition = new THREE.Float32BufferAttribute([-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, 1, 0], 3);\n\nconst createRenderTarget = (width: number, height: number, options: THREE.RenderTargetOptions = {}) =>\n new THREE.RenderTarget(width, height, {\n type: THREE.HalfFloatType,\n format: THREE.RGBAFormat,\n minFilter: THREE.LinearFilter,\n magFilter: THREE.LinearFilter,\n generateMipmaps: false,\n depthBuffer: false,\n ...options,\n });\n\n// NOTE Froxel atlas. Spectral: a second target with the red and blue alpha (and the green alpha in w for blending).\nconst createAtlasTarget = (width: number, height: number, spectral: boolean) => {\n if (!spectral) {\n return createRenderTarget(width, height);\n }\n\n const target = createRenderTarget(width, height, { count: 2 });\n\n target.textures[1]!.format = THREE.RGFormat;\n\n return target;\n};\n\nconst isSpectralTarget = (target: THREE.RenderTarget) => target.textures.length > 1;\n\nconst createScene = () => {\n const scene = new THREE.Scene();\n scene.matrixWorldAutoUpdate = false;\n\n return scene;\n};\n\n// NOTE Instanced tile quads: one instance for each slice\nconst createTileGeometry = () => {\n const geometry = new THREE.InstancedBufferGeometry();\n geometry.instanceCount = 0;\n geometry.setAttribute(\"position\", tileQuadPosition);\n\n return geometry;\n};\n\n// NOTE Clip rectangle of a froxel cell rectangle, padding cells larger on each side. An empty rectangle stays empty.\nconst clipRect = { x0: 0, y0: 0, x1: 0, y1: 0 };\n\nconst getClipRect = (rect: THREE.Vector4, width: number, height: number, padding: number) => {\n if (rect.z <= rect.x || rect.w <= rect.y) {\n clipRect.x0 = clipRect.y0 = clipRect.x1 = clipRect.y1 = 0.0;\n\n return clipRect;\n }\n\n clipRect.x0 = (Math.max(0, rect.x - padding) / width) * 2.0 - 1.0;\n clipRect.y0 = (Math.max(0, rect.y - padding) / height) * 2.0 - 1.0;\n clipRect.x1 = (Math.min(width, rect.z + padding) / width) * 2.0 - 1.0;\n clipRect.y1 = (Math.min(height, rect.w + padding) / height) * 2.0 - 1.0;\n\n return clipRect;\n};\n\nconst getMaxTextureSize = (renderer: WebGPURenderer) => {\n const backend = renderer.backend as unknown as { device?: GPUDevice };\n\n return backend.device ? backend.device.limits.maxTextureDimension2D : Infinity;\n};\n\n// NOTE What the shadow density pass reads of a caster's source: its identity, version and LOD mode\n// (his pushCasterMaps pushes the texture ids and versions). A new source or a replaced grid draws again.\nconst sourceIds = new WeakMap<object, number>();\nlet nextSourceId = 1;\n\nconst pushCasterSource = (values: number[], frameVolume: VDBFrameVolume) => {\n const source = frameVolume.source as unknown as { version?: number; lod?: string; lodLevels: number; kind: string; textures?: Record<string, { map: THREE.Texture; mip: THREE.Texture | null } | null> };\n let id = sourceIds.get(source);\n\n if (id === undefined) {\n id = nextSourceId++;\n sourceIds.set(source, id);\n }\n\n values.push(id, source.version ?? -1, source.lodLevels, source.lod === \"node-average\" ? 2 : source.lod === \"none\" ? 0 : 1);\n\n if (source.textures) {\n for (const name of [\"density\", \"mask\", \"albedo\"]) {\n const t = source.textures[name];\n\n values.push(t ? t.map.id : -1, t ? t.map.version : -1, t?.mip ? t.mip.id : -1, t?.mip ? t.mip.version : -1);\n }\n }\n};\n\n// NOTE An id for each network object (the transmittance signature: a swapped network draws again)\nconst networkIds = new WeakMap<object, number>();\nlet nextNetworkId = 1;\n\nconst networkId = (network: VDBFrameNeuralNetwork): number => {\n let id = networkIds.get(network);\n\n if (id === undefined) {\n id = nextNetworkId++;\n networkIds.set(network, id);\n }\n\n return id;\n};\n\ninterface LightRecord {\n position: THREE.Vector4;\n color: THREE.Vector4;\n spot: THREE.Vector4;\n falloff: THREE.Vector2;\n}\n\ninterface LightList {\n length: number;\n entries: LightRecord[];\n}\n\ninterface PoolEntry {\n mesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n geometry: THREE.InstancedBufferGeometry;\n frameVolume: VDBFrameVolume | null;\n volume: FrameVolumeRecord | null;\n rect: THREE.Vector4;\n sliceStart: number;\n}\n\ninterface PassMaterial extends THREE.Material {\n volumeUniforms: FrameVolumeUniforms;\n sourceUniforms: VDBVolumeUniforms;\n frameRect: { value: THREE.Vector4 };\n frameSliceStart: { value: number };\n}\n\ninterface LightResult {\n shadowLightCount: number;\n environmentLightCount: number;\n environmentShadowSlot: number;\n environmentGridLights: { direction: number[]; color: number[] }[];\n}\n\ntype RendererLike = WebGPURenderer & { isWebGPURenderer?: boolean };\ntype SceneLike = THREE.Object3D & { overrideMaterial?: THREE.Material | null; environment?: THREE.Texture | null; environmentIntensity?: number; environmentRotation?: THREE.Euler };\n\n/** His `FrameRenderer` (`'volume'` and `'frame'` lighting). One instance can serve many volumes and cameras. */\nexport class VDBFrameRenderer {\n settings: VDBFrameRendererSettings = {\n width: 512,\n height: 512,\n pixelsPerFroxel: 0,\n depth: 24,\n subSteps: 32,\n near: 0.1,\n far: Infinity,\n fadeRadius: Infinity,\n jitter: false,\n temporal: true,\n temporalBlend: 0.2,\n lighting: \"frame\",\n shadowResolution: 64,\n shadowCascades: 1,\n shadowDistance: 512,\n phase: \"henyey-greenstein\",\n phaseG: 0.8,\n phaseBackG: -0.3,\n phaseBackWeight: 0.2,\n phaseGExponent: 0.0,\n srgbBlending: true,\n environmentLighting: \"directional\",\n environmentSamples: 8,\n environmentShOrder: 1,\n multipleScattering: \"neural\",\n scatteringOctaves: 4,\n scatteringOctaveExtinction: 0.5,\n scatteringOctaveContribution: 0.5,\n scatteringOctavePhase: 0.5,\n spectral: false,\n castShadows: false,\n castShadowMapSize: 512,\n castShadowCascades: 1,\n castShadowDistance: 4000,\n castShadowSteps: 32,\n castShadowUpdatesPerFrame: 1,\n castShadowCoarse: false,\n };\n\n /**\n * The network of multipleScattering `'neural'` (default: his trained weights, `@pmndrs/vdb/tools`\n * `vdbFrameNeuralWeights`; see THIRD_PARTY_NOTICES.md for their provenance). Set another network of the same\n * shape to swap it, or null to run `'neural'` as 1D diffusion (warns once). Not his (his is a module import).\n */\n neuralNetwork: VDBFrameNeuralNetwork | null = vdbFrameNeuralWeights;\n\n /** Per-pass hooks (timing, debugging). */\n passHook: VDBFramePassHook | null = null;\n\n /**\n * Timing/debug hook: proxies draw the integrate pass over the last froxel atlas without rendering\n * the froxels again (the per-pass timing harness times integrate alone with it). Not his.\n */\n holdFroxels = false;\n\n /** Redraws and skips of the signature-cached 'frame' passes (the K3.3 redraw-skip rate). Not his. */\n readonly redrawStats: VDBFrameRedrawStats = {\n shadowDensity: { drawn: 0, skipped: 0 },\n transmittance: { drawn: 0, skipped: 0 },\n environmentGrid: { drawn: 0, skipped: 0 },\n };\n\n // NOTE TSL uniform nodes. Passes share them, the CPU writes .value.\n readonly froxelUniforms = createFroxelUniforms();\n // NOTE Canvas and drawing buffer sizes that settings.pixelsPerFroxel holds (layout.ts getFroxelSize)\n readonly froxelHeldSize = { canvasX: 0, canvasY: 0, bufferX: 0, bufferY: 0 };\n readonly froxelTileUniforms = createTileUniforms();\n // NOTE Froxel area of all volumes. Passes over the froxel grid draw only this area.\n readonly froxelAreaUniforms = createAreaUniforms();\n readonly froxelArea = { rect: new THREE.Vector4(), first: 0, count: 0 };\n readonly areaGeometry = createTileGeometry();\n readonly gridUniforms = createGridUniforms(this.froxelUniforms.frameJitter);\n readonly gridTileUniforms = createTileUniforms();\n readonly densityShadowUniforms = createDensityShadowUniforms();\n readonly lightUniforms = createLightUniforms();\n readonly environmentGridUniforms = createEnvironmentGridUniforms();\n // NOTE Octaves of the settings (getFrameScatteringOctaves), for the signatures\n readonly scatteringOctaves = new THREE.Vector4();\n\n readonly integrateMaterial: VDBFrameIntegrateMaterial;\n readonly lightingMaterial: VDBFrameLightingMaterial;\n readonly transmittanceMaterial: VDBFrameTransmittanceMaterial;\n readonly temporalMaterial: VDBFrameTemporalMaterial;\n\n // NOTE The light scene draws the volume inject pass or the lighting pass. The inject mesh takes the inject material of each volume.\n readonly injectScene = createScene();\n readonly injectMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material> = new THREE.Mesh(createTileGeometry(), new THREE.MeshBasicMaterial());\n readonly lightingMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n\n readonly densityScene = createScene();\n densityPool: PoolEntry[] = [];\n // NOTE Clears the density targets in the froxel area (one draw for all targets)\n readonly densityClearMaterial = new NodeMaterial();\n readonly densityClearScene = createScene();\n readonly densityClearMesh: THREE.Mesh<THREE.InstancedBufferGeometry, NodeMaterial>;\n\n readonly shadowScene = createScene();\n shadowPool: PoolEntry[] = [];\n\n readonly transmittanceScene = createScene();\n readonly transmittanceMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n\n readonly temporalScene = createScene();\n readonly temporalMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n historyTargets: [THREE.RenderTarget | null, THREE.RenderTarget | null] = [null, null];\n historyIndex = 0;\n historyValid = false;\n historyCamera: THREE.Camera | null = null;\n readonly previousViewMatrix = new THREE.Matrix4();\n readonly previousProjectionMatrix = new THREE.Matrix4();\n readonly previousRange = new THREE.Vector2(0.1, 1.0);\n jitterIndex = 0;\n\n // NOTE Environment lights from a small map of the scene environment (tools/frame/environment.ts)\n environmentLights: VDBFrameEnvironmentLights<RendererLike, SceneLike & VDBFrameEnvironmentSceneFields>;\n readonly environmentMapMaterial = new VDBFrameEnvironmentMapMaterial();\n readonly environmentMapScene = createScene();\n readonly environmentMapMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n readonly environmentMapCamera = new THREE.OrthographicCamera(-1.0, 1.0, 1.0, -1.0, 0.0, 1.0);\n environmentMapTarget: THREE.RenderTarget | null = null;\n environment: VDBFrameEnvironmentResult | null = null;\n\n // NOTE Environment grid: environment light of the last cascade voxels, from the environment lights with no slot\n readonly environmentGridMaterial: VDBFrameEnvironmentGridMaterial;\n readonly environmentGridScene = createScene();\n readonly environmentGridMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n environmentGridTarget: THREE.RenderTarget | null = null;\n environmentGridSignature: number[] = [];\n nextEnvironmentGridSignature: number[] = [];\n\n // NOTE multipleScattering 'neural': mips of the last grid cascade, levels 1 and up (VDBFrameGridMipMaterial)\n readonly gridMipMaterial = new VDBFrameGridMipMaterial();\n readonly gridMipScene = createScene();\n readonly gridMipMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n gridMipTargets: THREE.RenderTarget[] = [];\n gridMipSignature: number[] = [];\n\n atlasTarget: THREE.RenderTarget | null = null;\n densityTarget: THREE.RenderTarget | null = null;\n shadowDensityTarget: THREE.RenderTarget | null = null;\n transmittanceTarget: THREE.RenderTarget | null = null;\n // NOTE Renderer settings.spectral: 3 transmittance targets for each slot group in use (spectrum.ts).\n // Made when a group is first used. transmittanceTarget is null then.\n spectralTransmittanceTargets: THREE.RenderTarget[] = [];\n lightLimitWarned = false;\n private readonly warned = new Set<string>();\n\n // NOTE Shadow grid state: cascades of the last update, signatures (tools/frame/grid.ts)\n readonly gridState: VDBFrameGridSignatureState = vdbFrameGridSignatureState();\n // NOTE World shadow grid of the current render. Volume shadows make it before the first lit mesh; 'frame' lighting\n // then uses it again (gridFreshCamera). gridState.castVersion changes when the last cascade (all volumes) changes.\n gridRenderId = -1;\n gridCamera: THREE.Camera | null = null;\n gridFreshCamera: THREE.Camera | null = null;\n gridReady = false;\n /** K3.6: volume shadows on meshes (settings.castShadows). */\n volumeShadows: VDBFrameVolumeShadows;\n // NOTE gridVersion and target of the last shadow density draw. The same version is not drawn again.\n shadowDrawnVersion = -1;\n shadowDrawnTarget: THREE.RenderTarget | null = null;\n transmittanceSignature: number[] = [];\n nextTransmittanceSignature: number[] = [];\n\n // NOTE collectVolumes result of the current render\n readonly collected: { renderId: number; camera: THREE.Camera | null; scene: THREE.Object3D | null; result: FrameVolumeCollector<VDBFrameVolume> | null } = {\n renderId: -1,\n camera: null,\n scene: null,\n result: null,\n };\n readonly volumeCollector = new FrameVolumeCollector<VDBFrameVolume>();\n readonly sliceRange = { first: 0, count: 0 };\n readonly gridRange = { rect: new THREE.Vector4(), first: 0, count: 0 };\n readonly cascadeCasterPool: { items: { caster: FrameVolumeEntry<VDBFrameVolume>; cascade: number }[]; entries: { caster: FrameVolumeEntry<VDBFrameVolume>; cascade: number }[] } = { items: [], entries: [] };\n readonly lightState = {\n camera: null as THREE.Camera | null,\n hemiCount: 0,\n hasSky: false,\n directions: { length: 0, entries: [] } as LightList,\n points: { length: 0, entries: [] } as LightList,\n spots: { length: 0, entries: [] } as LightList,\n };\n readonly lightResult: LightResult = { shadowLightCount: 0, environmentLightCount: 0, environmentShadowSlot: 0, environmentGridLights: [] };\n readonly environmentGridLightEntries: { direction: number[]; color: number[] }[] = [];\n\n cachedFrame = -1;\n cachedCamera: THREE.Camera | null = null;\n rendererWarned = false;\n\n constructor() {\n this.integrateMaterial = new VDBFrameIntegrateMaterial({ froxelUniforms: this.froxelUniforms });\n this.lightingMaterial = new VDBFrameLightingMaterial({\n froxelUniforms: this.froxelUniforms,\n froxelTileUniforms: this.froxelTileUniforms,\n froxelAreaUniforms: this.froxelAreaUniforms,\n lightUniforms: this.lightUniforms,\n gridUniforms: this.gridUniforms,\n densityShadowUniforms: this.densityShadowUniforms,\n });\n this.transmittanceMaterial = new VDBFrameTransmittanceMaterial({ gridUniforms: this.gridUniforms, lightUniforms: this.lightUniforms });\n this.temporalMaterial = new VDBFrameTemporalMaterial({ froxelUniforms: this.froxelUniforms, froxelTileUniforms: this.froxelTileUniforms, froxelAreaUniforms: this.froxelAreaUniforms });\n this.environmentGridMaterial = new VDBFrameEnvironmentGridMaterial({ gridUniforms: this.gridUniforms, environmentGridUniforms: this.environmentGridUniforms, lightUniforms: this.lightUniforms });\n this.environmentLights = new VDBFrameEnvironmentLights((renderer, scene) => this.renderEnvironmentMap(renderer, scene));\n this.volumeShadows = new VDBFrameVolumeShadows(this);\n\n this.lightingMesh = new THREE.Mesh(this.areaGeometry, this.lightingMaterial);\n this.densityClearMesh = new THREE.Mesh(this.areaGeometry, this.densityClearMaterial);\n this.transmittanceMesh = new THREE.Mesh(createFullscreenGeometry(), this.transmittanceMaterial);\n this.temporalMesh = new THREE.Mesh(this.areaGeometry, this.temporalMaterial);\n this.environmentMapMesh = new THREE.Mesh(createFullscreenGeometry(), this.environmentMapMaterial);\n this.environmentGridMesh = new THREE.Mesh(createFullscreenGeometry(), this.environmentGridMaterial);\n this.gridMipMesh = new THREE.Mesh(createFullscreenGeometry(), this.gridMipMaterial);\n\n for (const mesh of [this.injectMesh, this.lightingMesh, this.transmittanceMesh, this.temporalMesh, this.densityClearMesh, this.environmentMapMesh, this.environmentGridMesh, this.gridMipMesh]) {\n mesh.frustumCulled = false;\n }\n\n this.temporalScene.add(this.temporalMesh);\n\n this.densityClearMaterial.vertexNode = frameTileVertex(this.froxelTileUniforms, this.froxelAreaUniforms.frameAreaRect, this.froxelAreaUniforms.frameAreaSliceStart);\n this.densityClearMaterial.fragmentNode = outputStruct(vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0));\n this.densityClearMaterial.depthTest = false;\n this.densityClearMaterial.depthWrite = false;\n this.densityClearMaterial.blending = THREE.NoBlending;\n this.densityClearScene.add(this.densityClearMesh);\n\n this.injectScene.add(this.injectMesh, this.lightingMesh);\n this.transmittanceScene.add(this.transmittanceMesh);\n this.environmentMapScene.add(this.environmentMapMesh);\n this.environmentGridScene.add(this.environmentGridMesh);\n this.gridMipScene.add(this.gridMipMesh);\n }\n\n private warnOnce(key: string, message: string): void {\n if (!this.warned.has(key)) {\n this.warned.add(key);\n console.warn(`VDBFrameRenderer: ${message}`);\n }\n }\n\n // NOTE Each frame volume proxy calls this. The first proxy in a frame renders the frame. Other proxies draw nothing.\n render(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, proxy: THREE.Mesh<THREE.InstancedBufferGeometry>): void {\n if (!renderer.isWebGPURenderer) {\n if (!this.rendererWarned) {\n console.error(\"VDBFrameVolume: needs WebGPURenderer (three/webgpu).\");\n this.rendererWarned = true;\n }\n\n return;\n }\n\n const frame = renderer.info.render.calls;\n\n // NOTE Override passes (depth, normals) of other effects must not draw or start the frame\n if (scene.overrideMaterial) {\n proxy.geometry.instanceCount = 0;\n\n return;\n }\n\n if (frame === this.cachedFrame && camera === this.cachedCamera) {\n proxy.geometry.instanceCount = 0;\n\n return;\n }\n\n // NOTE Puts the volume shadow filter on new shadow lights (and frees the maps of removed ones)\n this.volumeShadows.update(renderer, scene);\n\n if (this.holdFroxels && this.atlasTarget) {\n this.cachedFrame = frame;\n this.cachedCamera = camera;\n proxy.geometry.instanceCount = 1;\n\n return;\n }\n\n const { volumes, casters } = this.collectVolumes(renderer, scene, camera);\n\n if (volumes.length > 0) {\n this.renderFrame(renderer, scene, camera, volumes, casters);\n }\n\n // NOTE Nested renders increase info.render.calls. Keep the new value. Then other proxies in this frame skip.\n this.cachedFrame = renderer.info.render.calls;\n this.cachedCamera = camera;\n\n proxy.geometry.instanceCount = volumes.length > 0 ? 1 : 0;\n }\n\n /**\n * Draws only the froxel atlas for this scene and camera (no integrate): the per-pass timing\n * harness renders this alone. Returns the number of volumes in view.\n */\n renderFroxels(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera): number {\n this.collected.renderId = -1;\n const { volumes, casters } = this.collectVolumes(renderer, scene, camera);\n\n if (volumes.length > 0) {\n this.renderFrame(renderer, scene, camera, volumes, casters);\n }\n\n return volumes.length;\n }\n\n // NOTE A quad. The integrate material puts it on the screen rectangle of the froxel area.\n createProxyGeometry(): THREE.InstancedBufferGeometry {\n const geometry = createTileGeometry();\n\n geometry.instanceCount = 1;\n\n return geometry;\n }\n\n isFrameLighting(): boolean {\n return this.settings.lighting === \"frame\";\n }\n\n // NOTE The world shadow grid is used by 'frame' lighting and by volume shadows on meshes\n usesShadowGrid(): boolean {\n return this.isFrameLighting() || this.settings.castShadows;\n }\n\n // NOTE Visible volumes and shadow casters, one time in a render (the render id of three.js NodeFrame, internal)\n collectVolumes(renderer: RendererLike, scene: THREE.Object3D, camera: THREE.Camera): FrameVolumeCollector<VDBFrameVolume> {\n const renderId = (renderer as unknown as { _nodes?: { nodeFrame?: { renderId?: number } } })._nodes?.nodeFrame?.renderId ?? -1;\n const { collected } = this;\n\n if (renderId !== -1 && collected.renderId === renderId && collected.camera === camera && collected.scene === scene && collected.result) {\n return collected.result;\n }\n\n collected.renderId = renderId;\n collected.camera = camera;\n collected.scene = scene;\n collected.result = this.volumeCollector.collect(scene, camera as THREE.PerspectiveCamera, this.settings, this.usesShadowGrid(), null);\n\n if (collected.result.volumes.length > 0) {\n this.froxelUniforms.froxelRange.value.set(collected.result.near, collected.result.far);\n }\n\n return collected.result;\n }\n\n // NOTE Slices of a volume. Returns this.sliceRange ({ first, count }), used again in the next call.\n getSliceRange(volume: FrameVolumeRecord) {\n const { froxelRange, froxelGrid } = this.froxelUniforms;\n\n return getFroxelSliceRange(volume, froxelRange.value, froxelGrid.value.z, this.sliceRange);\n }\n\n private checkSettings(): void {\n const s = this.settings;\n if (this.isFrameLighting() && s.multipleScattering === \"neural\" && !this.neuralNetwork) {\n this.warnOnce(\"neural\", \"multipleScattering 'neural' has no network (neuralNetwork is null); the scene light slots use 1D diffusion (true).\");\n }\n }\n\n /** The multiple scattering mode (settings.multipleScattering; 'neural' is diffusion outside the network). */\n private multipleScatteringMode(): VDBFrameMultipleScattering {\n return this.settings.multipleScattering;\n }\n\n isSpectral(): boolean {\n return this.settings.spectral === true;\n }\n\n // NOTE multipleScattering 'neural' uses the network only with grey 'frame' lighting. Other cases use diffusion.\n isNeural(): boolean {\n if (this.settings.multipleScattering !== \"neural\" || this.settings.spectral || !this.neuralNetwork) return false;\n const problem = vdbFrameNeuralCheck(this.neuralNetwork);\n if (problem) {\n this.warnOnce(\"neural-shape\", `neuralNetwork ${this.neuralNetwork.name ?? \"\"} does not fit the shader (${problem}); using 1D diffusion.`);\n return false;\n }\n return true;\n }\n\n // NOTE Mips of the last grid cascade for the network. Drawn again only when the grid changes.\n renderGridMips(renderer: RendererLike, camera: THREE.Camera): void {\n const { frameGridResolution, frameGridColumns, frameGridCount } = this.gridUniforms;\n const resolution = frameGridResolution.value as number;\n const source = this.shadowDensityTarget!;\n const signature = [this.gridState.gridVersion, source.texture.id, resolution, frameGridCount.value as number, frameGridColumns.value as number];\n\n if (vdbSameValues(signature, this.gridMipSignature)) {\n return;\n }\n\n this.gridMipSignature = signature;\n this.gridMipMesh.layers.mask = camera.layers.mask;\n\n const material = this.gridMipMaterial;\n const { frameNeuralMipMaps, frameNeuralMipLayouts } = this.transmittanceMaterial;\n // NOTE Source of the next level: the grid atlas first, then the level before\n let previous: { target: THREE.RenderTarget; side: number; layout: { columns: number; width: number; height: number } } | null = null;\n\n for (let level = 1; level <= frameNeuralMipLevels; level++) {\n const side = Math.max(1, resolution >> level);\n const layout = getAtlasLayout(side, side, side);\n let target = this.gridMipTargets[level - 1];\n\n if (!target || target.width !== layout.width || target.height !== layout.height) {\n target?.dispose();\n target = createRenderTarget(layout.width, layout.height, { format: THREE.RGFormat });\n this.gridMipTargets[level - 1] = target;\n }\n\n if (previous) {\n material.frameMipSource.value = previous.target.texture;\n material.frameMipSourceResolution.value = previous.side;\n material.frameMipSourceColumns.value = previous.layout.columns;\n material.frameMipSourceTile.value = 0;\n material.frameMipSourceSize.value.set(previous.layout.width, previous.layout.height);\n } else {\n material.frameMipSource.value = source.texture;\n material.frameMipSourceResolution.value = resolution;\n material.frameMipSourceColumns.value = frameGridColumns.value as number;\n material.frameMipSourceTile.value = ((frameGridCount.value as number) - 1) * resolution;\n material.frameMipSourceSize.value.set(source.width, source.height);\n }\n\n material.frameMipResolution.value = side;\n material.frameMipColumns.value = layout.columns;\n material.frameMipSize.value.set(layout.width, layout.height);\n renderer.setRenderTarget(target);\n renderer.render(this.gridMipScene, camera);\n\n frameNeuralMipMaps[level - 1]!.value = target.texture;\n frameNeuralMipLayouts[level - 1]!.value.set(layout.columns, layout.width, layout.height);\n previous = { target, side, layout };\n }\n }\n\n // NOTE The 3 transmittance targets of a spectral slot group, the same size as the shadow grid\n getSpectralTransmittanceTarget(group: number): THREE.RenderTarget {\n const targets = this.spectralTransmittanceTargets;\n\n while (targets.length <= group) {\n const { width, height } = this.shadowDensityTarget!;\n\n targets.push(createRenderTarget(width, height, { count: 3 }));\n }\n\n return targets[group]!;\n }\n\n // NOTE The lighting and density passes keep their group textures bound when they do not read them: they get their\n // own placeholders (one texture each, see renderFrameLighting), not the disposed targets.\n disposeSpectralTransmittanceTargets(): void {\n this.spectralTransmittanceTargets.forEach((target) => target.dispose());\n this.spectralTransmittanceTargets = [];\n\n for (const map of [...this.lightingMaterial.frameSpectralTransmittanceMaps, ...this.densityShadowUniforms.frameSkyTransmittanceMaps]) {\n map.value = new THREE.Texture();\n }\n }\n\n updateTargets(renderer: RendererLike): void {\n const { depth, subSteps } = this.settings;\n const { width, height } = getFroxelSize(this.settings, renderer, froxelSize, this.froxelHeldSize);\n const spectral = this.isSpectral();\n const froxelAtlas = getAtlasLayout(width, height, depth);\n\n if (!this.atlasTarget || this.atlasTarget.width !== froxelAtlas.width || this.atlasTarget.height !== froxelAtlas.height || isSpectralTarget(this.atlasTarget) !== spectral) {\n const maxTextureSize = getMaxTextureSize(renderer);\n\n if (froxelAtlas.width > maxTextureSize || froxelAtlas.height > maxTextureSize) {\n console.warn(\"VDBFrameRenderer: froxel atlas is larger than maxTextureSize. Decrease width, height or depth.\");\n }\n\n this.atlasTarget?.dispose();\n this.atlasTarget = createAtlasTarget(froxelAtlas.width, froxelAtlas.height, spectral);\n this.historyValid = false;\n }\n\n // NOTE The per-volume inject materials are set in renderInject\n this.lightingMaterial.setSpectral(spectral);\n this.temporalMaterial.setSpectral(spectral);\n this.integrateMaterial.setSpectral(spectral);\n\n const { froxelGrid, froxelColumns } = this.froxelUniforms;\n\n // NOTE A new grid layout makes the history unusable, also when the atlas keeps its size (600 x 400 to 400 x 600)\n if (froxelGrid.value.x !== width || froxelGrid.value.y !== height || froxelGrid.value.z !== depth || froxelColumns.value !== froxelAtlas.columns) {\n this.historyValid = false;\n }\n\n froxelGrid.value.set(width, height, depth);\n froxelColumns.value = froxelAtlas.columns;\n this.froxelUniforms.froxelSubSteps.value = Math.max(1, Math.round(subSteps));\n this.froxelTileUniforms.frameTileSize.value.set(width, height);\n this.froxelTileUniforms.frameTileColumns.value = froxelAtlas.columns;\n this.froxelTileUniforms.frameTargetSize.value.set(froxelAtlas.width, froxelAtlas.height);\n this.froxelUniforms.froxelAtlasSize.value.set(froxelAtlas.width, froxelAtlas.height);\n this.integrateMaterial.froxelAtlas.value = this.atlasTarget.textures[0];\n this.integrateMaterial.froxelAlphaAtlas.value = this.atlasTarget.textures[spectral ? 1 : 0];\n\n if (this.settings.temporal) {\n for (let index = 0; index < this.historyTargets.length; index++) {\n const target = this.historyTargets[index];\n\n if (!target || target.width !== froxelAtlas.width || target.height !== froxelAtlas.height || isSpectralTarget(target) !== spectral) {\n target?.dispose();\n this.historyTargets[index] = createAtlasTarget(froxelAtlas.width, froxelAtlas.height, spectral);\n this.historyValid = false;\n }\n }\n }\n\n if (this.isFrameLighting()) {\n // NOTE Spectral: 3 targets (albedo, emission, extinction of each channel), no light slot targets\n const densityCount = spectral ? 3 : 4;\n\n if (!this.densityTarget || this.densityTarget.width !== froxelAtlas.width || this.densityTarget.height !== froxelAtlas.height || this.densityTarget.textures.length !== densityCount) {\n this.densityTarget?.dispose();\n this.densityTarget = createRenderTarget(froxelAtlas.width, froxelAtlas.height, { count: densityCount, minFilter: THREE.NearestFilter, magFilter: THREE.NearestFilter });\n this.densityClearMaterial.fragmentNode = outputStruct(...Array.from({ length: densityCount }, () => vec4(0.0)));\n this.densityClearMaterial.needsUpdate = true;\n }\n\n this.updateGridTargets();\n }\n }\n\n updateGridTargets(): void {\n const resolution = Math.max(2, Math.round(this.settings.shadowResolution));\n const cascades = this.getCascadeCount();\n const gridAtlas = getAtlasLayout(resolution, resolution, resolution * cascades);\n const spectral = this.isSpectral();\n\n if (!this.shadowDensityTarget || this.shadowDensityTarget.width !== gridAtlas.width || this.shadowDensityTarget.height !== gridAtlas.height || isSpectralTarget(this.shadowDensityTarget) !== spectral) {\n this.shadowDensityTarget?.dispose();\n this.transmittanceTarget?.dispose();\n this.disposeSpectralTransmittanceTargets();\n\n // NOTE Extinction and absorption. Spectral: (extinction rgb, 0) and (absorption rgb, 0).\n this.shadowDensityTarget = spectral ? createRenderTarget(gridAtlas.width, gridAtlas.height, { count: 2 }) : createRenderTarget(gridAtlas.width, gridAtlas.height, { format: THREE.RGFormat });\n // NOTE Total transmittance (2 targets), then direct transmittance of the light slots (2 targets).\n // Spectral: the slot group targets (getSpectralTransmittanceTarget).\n this.transmittanceTarget = spectral ? null : createRenderTarget(gridAtlas.width, gridAtlas.height, { count: 4 });\n\n // NOTE A new target is empty, so the last cascade and the environment grid are drawn again\n this.gridState.castSignature = [];\n this.environmentGridSignature = [];\n }\n\n // NOTE The per-volume shadow density materials are set in getShadowDensityMaterial\n this.transmittanceMaterial.setSpectral(spectral);\n this.environmentGridMaterial.setSpectral(spectral);\n\n // NOTE The environment grid is one cascade. A new target is empty, so the signature is reset.\n const environmentAtlas = getAtlasLayout(resolution, resolution, resolution);\n\n if (!this.environmentGridTarget || this.environmentGridTarget.width !== environmentAtlas.width || this.environmentGridTarget.height !== environmentAtlas.height) {\n this.environmentGridTarget?.dispose();\n this.environmentGridTarget = createRenderTarget(environmentAtlas.width, environmentAtlas.height);\n this.environmentGridSignature = [];\n }\n\n this.environmentGridUniforms.frameEnvironmentGridColumns.value = environmentAtlas.columns;\n this.environmentGridUniforms.frameEnvironmentGridAtlasSize.value.set(environmentAtlas.width, environmentAtlas.height);\n\n this.gridUniforms.frameGridResolution.value = resolution;\n this.gridUniforms.frameGridColumns.value = gridAtlas.columns;\n this.gridUniforms.frameGridAtlasSize.value.set(gridAtlas.width, gridAtlas.height);\n this.gridTileUniforms.frameTileSize.value.set(resolution, resolution);\n this.gridTileUniforms.frameTileColumns.value = gridAtlas.columns;\n this.gridTileUniforms.frameTargetSize.value.set(gridAtlas.width, gridAtlas.height);\n }\n\n renderFrame(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>[\"volumes\"], casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"] = []): void {\n this.checkSettings();\n\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\n // NOTE null: the environment uses the 'outward' path. 'volume' lighting marches every environment light in each volume.\n this.environment = this.environmentLights.update(renderer, scene as never, this.settings);\n\n this.updateTargets(renderer);\n this.updateFroxelArea(volumes, camera);\n\n const cam = camera as THREE.PerspectiveCamera & { isOrthographicCamera?: boolean };\n this.froxelUniforms.froxelProjectionInverse.value.copy(camera.projectionMatrixInverse);\n this.froxelUniforms.frameFadeRadius.value = getFrameFadeRadius(this.settings);\n this.integrateMaterial.frameCameraNear.value = cam.near;\n this.integrateMaterial.frameCameraFar.value = cam.far;\n this.integrateMaterial.frameCameraOrthographic.value = cam.isOrthographicCamera ? 1 : 0;\n this.integrateMaterial.setSrgbBlending(this.settings.srgbBlending && renderer.outputColorSpace === THREE.SRGBColorSpace, renderer.toneMapping === THREE.NoToneMapping);\n\n // NOTE Pass materials are unlit. Nested renders do not update shadow maps.\n renderer.autoClear = false;\n renderer.setScissorTest(false);\n renderer.setClearColor(0x000000, 0.0);\n\n // NOTE Golden ratio steps give a new, evenly spread jitter value for each frame\n this.froxelUniforms.frameJitter.value = this.settings.jitter ? (this.jitterIndex * 0.618034) % 1.0 : -1.0;\n this.jitterIndex = (this.jitterIndex + 1) % 1024;\n\n this.passHook?.begin?.(\"froxels\");\n\n if (this.isFrameLighting()) {\n this.renderFrameLighting(renderer, scene, camera, volumes, casters);\n } else {\n this.renderInject(renderer, scene, camera, volumes);\n }\n\n if (this.settings.temporal) {\n this.passHook?.begin?.(\"temporal\");\n this.renderTemporal(renderer, camera);\n this.passHook?.end?.(\"temporal\");\n } else {\n this.historyValid = false;\n }\n\n this.passHook?.end?.(\"froxels\");\n\n this.gridFreshCamera = null;\n\n renderer.setScissorTest(currentScissorTest);\n renderer.autoClear = currentAutoClear;\n renderer.setClearColor(clearColor, currentClearAlpha);\n renderer.setRenderTarget(currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel);\n }\n\n // NOTE Froxel area of the volumes, for the passes over the froxel grid and for the integrate pass\n updateFroxelArea(volumes: FrameVolumeCollector<VDBFrameVolume>[\"volumes\"], camera: THREE.Camera): void {\n const { froxelGrid, froxelRange } = this.froxelUniforms;\n const { x: width, y: height, z: depth } = froxelGrid.value;\n const area = getFroxelArea(volumes, camera, width, height, froxelRange.value, depth, this.froxelArea);\n const { frameAreaRect, frameAreaSliceStart } = this.froxelAreaUniforms;\n\n frameAreaRect.value.copy(area.rect);\n frameAreaSliceStart.value = area.first;\n this.areaGeometry.instanceCount = area.count;\n\n // NOTE One more cell on each side: the linear filter of the integrate pass reads one cell away\n const { x0, y0, x1, y1 } = getClipRect(area.rect, width, height, area.count > 0 ? 1 : 0);\n\n this.integrateMaterial.frameScreenRect.value.set(x0, y0, x1, y1);\n this.integrateMaterial.frameSliceRange.value.set(area.first, area.first + area.count);\n }\n\n // NOTE Blends this frame into the history. The integrate pass then reads the blended froxels.\n renderTemporal(renderer: RendererLike, camera: THREE.Camera): void {\n const material = this.temporalMaterial;\n const readTarget = this.historyTargets[this.historyIndex]!;\n const writeTarget = this.historyTargets[1 - this.historyIndex]!;\n const cam = camera as THREE.PerspectiveCamera;\n\n material.frameCurrentMap.value = this.atlasTarget!.textures[0];\n material.frameHistoryMap.value = readTarget.textures[0];\n material.frameCurrentAlphaMap.value = this.atlasTarget!.textures.at(-1);\n material.frameHistoryAlphaMap.value = readTarget.textures.at(-1);\n material.frameUseHistory.value = this.historyValid && this.historyCamera === camera ? 1 : 0;\n material.frameTemporalBlend.value = Math.min(1.0, Math.max(0.01, this.settings.temporalBlend));\n material.frameCameraMatrixWorld.value.copy(camera.matrixWorld);\n material.framePreviousViewMatrix.value.copy(this.previousViewMatrix);\n material.framePreviousProjectionMatrix.value.copy(this.previousProjectionMatrix);\n material.framePreviousRange.value.copy(this.previousRange);\n\n this.temporalMesh.layers.mask = camera.layers.mask;\n\n // NOTE The pass draws only the froxel area. The clear empties the other froxels.\n renderer.setRenderTarget(writeTarget);\n renderer.clear(true, false, false);\n renderer.render(this.temporalScene, camera);\n\n this.integrateMaterial.froxelAtlas.value = writeTarget.textures[0];\n this.integrateMaterial.froxelAlphaAtlas.value = writeTarget.textures.at(-1);\n\n this.historyIndex = 1 - this.historyIndex;\n this.historyValid = true;\n this.historyCamera = camera;\n this.previousViewMatrix.copy(camera.matrixWorldInverse);\n this.previousProjectionMatrix.copy(cam.projectionMatrix);\n this.previousRange.copy(this.froxelUniforms.froxelRange.value);\n }\n\n // NOTE PMREM rotation and intensity uniforms read the environment of the rendered pass scene\n copyEnvironment(target: THREE.Scene, scene: SceneLike): void {\n target.environment = scene.environment ?? null;\n target.environmentIntensity = scene.environmentIntensity ?? 1.0;\n if (scene.environmentRotation) target.environmentRotation.copy(scene.environmentRotation);\n }\n\n prepareLightScene(scene: SceneLike, camera: THREE.Camera, mesh: THREE.Mesh): LightResult {\n this.copyEnvironment(this.injectScene, scene);\n\n this.injectMesh.visible = mesh === this.injectMesh;\n this.lightingMesh.visible = mesh === this.lightingMesh;\n mesh.layers.mask = camera.layers.mask;\n\n return this.updateLights(scene, camera);\n }\n\n renderInject(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>[\"volumes\"]): void {\n const { atlasTarget, injectScene, injectMesh } = this;\n\n this.prepareLightScene(scene, camera, this.injectMesh);\n\n renderer.setRenderTarget(atlasTarget);\n renderer.clear(true, false, false);\n\n for (let i = 0; i < volumes.length; i++) {\n const { frameVolume, volume } = volumes[i]!;\n const injectMaterial = this.getInjectMaterial(frameVolume);\n\n // NOTE Draw only the froxel rectangle and the slices of this volume. One instance for each slice.\n if (!this.getFroxelRect(volume, camera, injectMaterial.frameRect.value)) {\n continue;\n }\n\n const { first, count } = this.getSliceRange(volume);\n\n injectMaterial.frameSliceStart.value = first;\n injectMesh.geometry.instanceCount = count;\n injectMesh.material = injectMaterial;\n\n injectMaterial.frameCameraMatrixWorld.value.copy(camera.matrixWorld);\n injectMaterial.setEnvironment(scene.environment);\n setVolumeUniforms(injectMaterial, frameVolume, volume);\n injectMaterial.frameLights.value = frameVolume.lights;\n injectMaterial.frameShadowSteps.value = frameVolume.shadowSteps;\n injectMaterial.frameMultipleScattering.value = getFrameMultipleScattering(this.multipleScatteringMode(), frameVolume.getPhase());\n getFrameScatteringOctaves(this.settings, injectMaterial.frameScatteringOctaves.value);\n injectMaterial.frameTwoSided.value = getFrameTwoSidedDiffusion(this.settings.multipleScattering);\n\n this.passHook?.begin?.(\"inject\", { volume: frameVolume });\n renderer.setRenderTarget(atlasTarget);\n renderer.render(injectScene, camera);\n this.passHook?.end?.(\"inject\", { volume: frameVolume });\n }\n }\n\n /** The inject material of a volume: its source is compiled in (DIVERGES: one material per source). */\n getInjectMaterial(frameVolume: VDBFrameVolume): VDBFrameInjectMaterial {\n const mipmaps = this.volumeMipmaps(frameVolume);\n let material = frameVolume.injectMaterial;\n\n if (!material || material.froxelUniforms !== this.froxelUniforms) {\n material?.dispose();\n material = new VDBFrameInjectMaterial({\n froxelUniforms: this.froxelUniforms,\n froxelTileUniforms: this.froxelTileUniforms,\n lightUniforms: this.lightUniforms,\n source: frameVolume.source,\n sourceUniforms: frameVolume.sourceUniforms,\n mipmaps,\n hdda: frameVolume.hdda,\n spectral: this.isSpectral(),\n ...(frameVolume.emissionColor ? { emissionColor: frameVolume.emissionColor } : {}),\n });\n frameVolume.injectMaterial = material;\n }\n\n material.setMipmaps(mipmaps);\n material.setHdda(frameVolume.hdda);\n material.setSpectral(this.isSpectral());\n // NOTE The hemisphere and environment-light loops are compiled in only when the scene has those lights (updateLights)\n material.setLightTerms((this.lightUniforms.frameHemiCount.value as number) > 0, (this.lightUniforms.frameEnvironmentCount.value as number) > 0);\n\n return material;\n }\n\n private volumeMipmaps(frameVolume: VDBFrameVolume): boolean {\n return frameVolume.mipmaps && frameVolume.source.lodLevels > 0;\n }\n\n /** The 'frame' density material of a volume (source compiled in, as the inject material). */\n getDensityMaterial(frameVolume: VDBFrameVolume): VDBFrameDensityMaterial {\n const mipmaps = this.volumeMipmaps(frameVolume);\n let material = frameVolume.densityMaterial;\n\n if (!material || material.frameUniforms.froxelUniforms !== this.froxelUniforms) {\n material?.dispose();\n material = new VDBFrameDensityMaterial({\n froxelUniforms: this.froxelUniforms,\n froxelTileUniforms: this.froxelTileUniforms,\n gridUniforms: this.gridUniforms,\n environmentGridUniforms: this.environmentGridUniforms,\n densityShadowUniforms: this.densityShadowUniforms,\n lightUniforms: this.lightUniforms,\n source: frameVolume.source,\n sourceUniforms: frameVolume.sourceUniforms,\n mipmaps,\n ...(frameVolume.emissionColor ? { emissionColor: frameVolume.emissionColor } : {}),\n });\n frameVolume.densityMaterial = material;\n }\n\n material.setMipmaps(mipmaps);\n material.setSpectral(this.isSpectral());\n\n return material;\n }\n\n /** The shadow density material of a caster (source compiled in). */\n getShadowDensityMaterial(frameVolume: VDBFrameVolume): VDBFrameShadowDensityMaterial {\n const mipmaps = this.volumeMipmaps(frameVolume);\n let material = frameVolume.shadowDensityMaterial;\n\n if (!material || material.gridUniforms !== this.gridUniforms) {\n material?.dispose();\n material = new VDBFrameShadowDensityMaterial({\n gridUniforms: this.gridUniforms,\n gridTileUniforms: this.gridTileUniforms,\n source: frameVolume.source,\n sourceUniforms: frameVolume.sourceUniforms,\n mipmaps,\n });\n frameVolume.shadowDensityMaterial = material;\n }\n\n material.setMipmaps(mipmaps);\n material.setSpectral(this.isSpectral());\n\n return material;\n }\n\n // NOTE Combined lighting: density of all volumes, one shadow grid, one lighting pass.\n // Lighting and transmittance render calls do not grow with the number of volumes.\n renderFrameLighting(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>[\"volumes\"], casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"]): void {\n const lights = this.prepareLightScene(scene, camera, this.lightingMesh);\n const ms = getFrameMultipleScattering(this.multipleScatteringMode(), this.settings);\n const octaves = getFrameScatteringOctaves(this.settings, this.scatteringOctaves);\n\n // NOTE Shadow pass. Extinction of all casters in one world grid, then transmittance to each light.\n // It is before the density pass. Then the density pass can sample the shadows of each volume.\n this.passHook?.begin?.(\"shadowDensity\");\n const useShadows = this.gridFreshCamera === camera ? this.gridReady : this.renderShadowDensity(renderer, camera, casters);\n this.passHook?.end?.(\"shadowDensity\");\n\n this.gridFreshCamera = null;\n const useEnvironmentGrid = useShadows && lights.environmentGridLights.length > 0;\n const spectral = this.isSpectral();\n const spectralGroups = getFrameSpectralGroups(lights.shadowLightCount);\n\n if (useShadows) {\n const material = this.transmittanceMaterial;\n\n material.frameShadowDensityMap.value = this.shadowDensityTarget!.textures[0];\n material.frameShadowAbsorptionMap.value = this.shadowDensityTarget!.textures.at(-1);\n material.frameShadowLightCount.value = lights.shadowLightCount;\n material.frameMultipleScattering.value = ms;\n material.frameScatteringOctaves.value.copy(octaves);\n material.frameTwoSided.value = getFrameTwoSidedDiffusion(this.settings.multipleScattering);\n this.transmittanceMesh.layers.mask = camera.layers.mask;\n material.setNeural(this.isNeural() ? this.neuralNetwork : null);\n\n if (material.neural) {\n this.passHook?.begin?.(\"gridMips\");\n this.renderGridMips(renderer, camera);\n this.passHook?.end?.(\"gridMips\");\n }\n\n if (this.transmittanceUnchanged(lights.shadowLightCount, spectral ? spectralGroups : 0)) {\n this.redrawStats.transmittance.skipped++;\n } else if (spectral) {\n this.redrawStats.transmittance.drawn++;\n this.passHook?.begin?.(\"transmittance\");\n\n // NOTE One pass for each slot group in use, each into its own targets\n for (let group = 0; group < spectralGroups; group++) {\n material.frameSpectralGroup.value = group;\n\n renderer.setRenderTarget(this.getSpectralTransmittanceTarget(group));\n renderer.render(this.transmittanceScene, camera);\n }\n\n this.passHook?.end?.(\"transmittance\");\n } else {\n this.redrawStats.transmittance.drawn++;\n this.passHook?.begin?.(\"transmittance\");\n renderer.setRenderTarget(this.transmittanceTarget);\n renderer.render(this.transmittanceScene, camera);\n this.passHook?.end?.(\"transmittance\");\n }\n }\n\n if (useEnvironmentGrid) {\n this.passHook?.begin?.(\"environmentGrid\");\n this.renderEnvironmentGrid(renderer, camera, casters, lights.environmentGridLights, ms, octaves);\n this.passHook?.end?.(\"environmentGrid\");\n }\n\n const { densityShadowUniforms } = this;\n\n densityShadowUniforms.frameUseShadows.value = useShadows ? 1 : 0;\n\n if (!spectral) {\n const transmittance = this.transmittanceTarget!;\n\n densityShadowUniforms.frameTransmittanceMap0.value = transmittance.textures[0];\n densityShadowUniforms.frameTransmittanceMap1.value = transmittance.textures[1];\n densityShadowUniforms.frameTransmittanceMap2.value = transmittance.textures[2];\n densityShadowUniforms.frameTransmittanceMap3.value = transmittance.textures[3];\n }\n\n densityShadowUniforms.frameShadowSceneLightCount.value = lights.environmentShadowSlot;\n getFramePhase(this.settings, densityShadowUniforms.framePhase.value);\n getFramePhaseSpectrum(this.settings, densityShadowUniforms.framePhaseSpectrum.value);\n densityShadowUniforms.frameScatteringOctaves.value.copy(octaves);\n densityShadowUniforms.frameDiffusion.value = isFrameDiffusion(this.multipleScatteringMode()) ? 1 : 0;\n densityShadowUniforms.frameEnvironmentGridMap.value = this.environmentGridTarget!.texture;\n densityShadowUniforms.frameEnvironmentMode.value = useEnvironmentGrid\n ? frameDensityEnvironment.grid\n : useShadows && lights.environmentLightCount > 0\n ? frameDensityEnvironment.none\n : frameDensityEnvironment.outward;\n densityShadowUniforms.frameCameraMatrixWorld.value.copy(camera.matrixWorld);\n\n // NOTE Spectral: sky up and sky down are in the first two targets of group 0 (bound also without shadows: not his)\n if (spectral) {\n const skyMaps = densityShadowUniforms.frameSkyTransmittanceMaps;\n\n for (let index = 0; index < skyMaps.length; index++) {\n skyMaps[index]!.value = this.getSpectralTransmittanceTarget(0).textures[index];\n }\n }\n\n this.copyEnvironment(this.densityScene, scene);\n\n // NOTE Density pass. One instanced draw for each volume, one instance for each slice.\n this.updatePool(this.densityPool, this.densityScene, volumes, camera, this.setupDensityEntry);\n\n this.densityClearMesh.layers.mask = camera.layers.mask;\n\n this.passHook?.begin?.(\"density\");\n renderer.setRenderTarget(this.densityTarget);\n renderer.render(this.densityClearScene, camera);\n renderer.render(this.densityScene, camera);\n this.passHook?.end?.(\"density\");\n\n // NOTE Lighting pass. Each froxel is lit one time from the combined data.\n const { lightingMaterial } = this;\n const density = this.densityTarget!;\n\n lightingMaterial.frameDensityAlbedoMap.value = density.textures[0];\n lightingMaterial.frameDensityEmissionMap.value = density.textures[1];\n\n if (spectral) {\n lightingMaterial.frameDensityExtinctionMap.value = density.textures[2];\n lightingMaterial.frameSpectralGroups.value = useShadows ? spectralGroups : 0;\n\n // NOTE Groups not in use keep the textures they have (their own targets or the initial placeholders); the lighting\n // pass does not read them. Not his (he gives them group 0's targets): three's TextureNode uniform hash is its\n // texture's uuid, so nodes that hold one texture when the shader is built share one binding, and a group that\n // came into use later (an environment light taking a slot after its readback) kept reading group 0.\n if (useShadows) {\n const maps = lightingMaterial.frameSpectralTransmittanceMaps;\n\n for (let index = 0; index < spectralGroups * 3; index++) {\n maps[index]!.value = this.getSpectralTransmittanceTarget(Math.floor(index / 3)).textures[index % 3];\n }\n }\n } else {\n lightingMaterial.frameDensityShadowMap0.value = density.textures[2];\n lightingMaterial.frameDensityShadowMap1.value = density.textures[3];\n }\n lightingMaterial.frameShadowLightCount.value = lights.shadowLightCount;\n lightingMaterial.frameEnvironmentLightCount.value = useShadows ? lights.environmentLightCount : 0;\n lightingMaterial.frameEnvironmentShadowSlot.value = lights.environmentShadowSlot;\n lightingMaterial.frameCameraMatrixWorld.value.copy(camera.matrixWorld);\n getFramePhase(this.settings, lightingMaterial.framePhase.value);\n getFramePhaseSpectrum(this.settings, lightingMaterial.framePhaseSpectrum.value);\n lightingMaterial.frameScatteringOctaves.value.copy(octaves);\n\n this.passHook?.begin?.(\"lighting\");\n renderer.setRenderTarget(this.atlasTarget);\n renderer.clear(true, false, false);\n renderer.render(this.injectScene, camera);\n this.passHook?.end?.(\"lighting\");\n }\n\n // NOTE Whether the transmittance target already holds what this render would draw: the same grid content, target,\n // shadow lights and settings. A jittered grid changes in each frame, so it is always drawn.\n transmittanceUnchanged(shadowLightCount: number, spectralGroups = 0): boolean {\n const material = this.transmittanceMaterial;\n const values = this.nextTransmittanceSignature;\n\n values.length = 0;\n // NOTE Spectral rendering has no single transmittance target, only the targets of its groups below\n values.push(this.gridState.gridVersion, this.shadowDensityTarget!.texture.id, this.transmittanceTarget ? this.transmittanceTarget.texture.id : -1, spectralGroups, shadowLightCount, material.frameMultipleScattering.value as number);\n // NOTE The network: on/off and which weights (a swapped network draws again)\n values.push(material.neural ? networkId(material.neural) : 0, material.frameTwoSided.value as number);\n vdbSignaturePushVector(values, material.frameScatteringOctaves.value);\n vdbSignaturePushVector(values, this.lightUniforms.frameSkyDirection.value);\n\n for (let group = 0; group < spectralGroups; group++) {\n values.push(this.getSpectralTransmittanceTarget(group).texture.id);\n }\n\n const shadowLights = material.frameShadowLights.array as THREE.Vector4[];\n\n for (let i = 0; i < shadowLightCount; i++) {\n vdbSignaturePushVector(values, shadowLights[i]!);\n }\n\n const jittered = (this.froxelUniforms.frameJitter.value as number) >= 0.0;\n const same = !jittered && vdbSameValues(values, this.transmittanceSignature);\n\n // NOTE A jittered draw matches no signature, so the first frame after jitter is turned off draws again\n if (jittered) {\n values.length = 0;\n }\n\n this.nextTransmittanceSignature = this.transmittanceSignature;\n this.transmittanceSignature = values;\n\n return same;\n }\n\n // NOTE Extinction of all casters in the world shadow grid cascades. Returns false with no casters.\n // NOTE onlyLast: only the last cascade (all volumes), drawn only when castVersion changed. Volume shadows on meshes\n // read only the last cascade; 'frame' lighting needs all cascades.\n renderShadowDensity(renderer: RendererLike, camera: THREE.Camera, casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"], onlyLast = false): boolean {\n const ready = casters.length > 0 && this.updateGrid(casters, camera);\n const castChanged = this.updateGridVersion(ready ? casters : []);\n\n if (!ready) {\n return false;\n }\n\n if (onlyLast && !castChanged) {\n this.redrawStats.shadowDensity.skipped++;\n\n return true;\n }\n\n if (!onlyLast && this.shadowDrawnVersion === this.gridState.gridVersion && this.shadowDrawnTarget === this.shadowDensityTarget) {\n this.redrawStats.shadowDensity.skipped++;\n\n return true;\n }\n\n this.redrawStats.shadowDensity.drawn++;\n // NOTE The clear below empties every cascade, so a draw of the last one alone leaves no full grid to keep\n this.shadowDrawnVersion = onlyLast ? -1 : this.gridState.gridVersion;\n this.shadowDrawnTarget = this.shadowDensityTarget;\n\n const count = this.gridUniforms.frameGridCount.value as number;\n const cascadeCasters = vdbFrameCascadeCasters(casters, onlyLast ? count - 1 : 0, count, this.cascadeCasterPool);\n\n this.updatePool(this.shadowPool, this.shadowScene, cascadeCasters, camera, this.setupShadowEntry);\n\n renderer.setRenderTarget(this.shadowDensityTarget);\n renderer.clear(true, false, false);\n renderer.render(this.shadowScene, camera);\n\n return true;\n }\n\n /**\n * Makes the world shadow grid one time in a render, before the first lit mesh (the volume shadow maps need it).\n * 'frame' lighting uses it again in the same render. Returns false with no casters. `renderId`: three's node frame\n * render id (three-internals.ts).\n */\n prepareShadowGrid(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, renderId: number): boolean {\n if (this.gridRenderId === renderId && this.gridCamera === camera) {\n return this.gridReady;\n }\n\n this.gridRenderId = renderId;\n this.gridCamera = camera;\n\n const { casters } = this.collectVolumes(renderer, scene, camera);\n\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 renderer.setClearColor(0x000000, 0.0);\n\n this.updateGridTargets();\n this.passHook?.begin?.(\"shadowDensity\");\n // NOTE 'volume' lighting: only the last cascade, for the volume shadow maps\n this.gridReady = this.renderShadowDensity(renderer, camera, casters, !this.isFrameLighting());\n this.passHook?.end?.(\"shadowDensity\");\n this.gridFreshCamera = camera;\n\n renderer.setScissorTest(currentScissorTest);\n renderer.autoClear = currentAutoClear;\n renderer.setClearColor(clearColor, currentClearAlpha);\n renderer.setRenderTarget(currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel);\n\n return this.gridReady;\n }\n\n // NOTE gridVersion changes when the cascades, a caster transform, a caster's data or a caster's shadow props change.\n // castVersion changes only for the last cascade. Returns true when castVersion changed.\n updateGridVersion(casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"]): boolean {\n const { frameGridMin, frameGridSize, frameGridCount, frameGridResolution } = this.gridUniforms;\n\n return vdbFrameUpdateGridSignatures(\n this.gridState,\n casters,\n frameGridCount.value as number,\n frameGridResolution.value as number,\n this.isSpectral(),\n frameGridMin.array as THREE.Vector3[],\n frameGridSize.array as THREE.Vector3[],\n (values, { frameVolume, volume }) => {\n vdbSignaturePushElements(values, volume.matrixWorld.elements);\n pushCasterSource(values, frameVolume);\n values.push(frameVolume.baseColor.r, frameVolume.baseColor.g, frameVolume.baseColor.b);\n values.push(frameVolume.getDensityScale(), frameVolume.densityCutoff, frameVolume.extinction);\n vdbSignaturePushVector(values, getFrameExtinctionSpectrum(frameVolume, extinctionSpectrum));\n values.push(frameVolume.absorbance, frameVolume.mipmaps ? 1 : 0, frameVolume.wrap3D);\n vdbSignaturePushVector(values, frameVolume.offset3D);\n },\n );\n }\n\n // NOTE Environment grid of the last cascade. It is drawn again only when its signature changes.\n // NOTE Signature: the grid lights, the last cascade, and the caster data that the shadow density pass reads.\n renderEnvironmentGrid(renderer: RendererLike, camera: THREE.Camera, casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"], gridLights: LightResult[\"environmentGridLights\"], ms: number, octaves: THREE.Vector4): void {\n const { frameGridMin, frameGridSize, frameGridCount, frameGridResolution } = this.gridUniforms;\n const cascade = (frameGridCount.value as number) - 1;\n const previous = this.environmentGridSignature;\n const signature = this.nextEnvironmentGridSignature;\n\n this.environmentGridUniforms.frameEnvironmentGridCascade.value = cascade;\n\n signature.length = 0;\n signature.push(frameGridResolution.value as number, cascade, this.isSpectral() ? 1 : 0, ms);\n vdbSignaturePushVector(signature, octaves);\n vdbSignaturePushVector(signature, (frameGridMin.array as THREE.Vector3[])[cascade]!);\n vdbSignaturePushVector(signature, (frameGridSize.array as THREE.Vector3[])[cascade]!);\n\n for (const light of gridLights) {\n vdbSignaturePushElements(signature, light.direction);\n vdbSignaturePushElements(signature, light.color);\n }\n\n // NOTE The caster data the shadow density pass reads: the grid version covers it (transforms, sources, props)\n signature.push(this.gridState.castVersion, casters.length);\n\n if (vdbSameValues(signature, previous)) {\n this.redrawStats.environmentGrid.skipped++;\n\n return;\n }\n\n this.redrawStats.environmentGrid.drawn++;\n this.environmentGridSignature = signature;\n this.nextEnvironmentGridSignature = previous;\n\n const material = this.environmentGridMaterial;\n\n material.frameShadowDensityMap.value = this.shadowDensityTarget!.textures[0];\n material.frameShadowAbsorptionMap.value = this.shadowDensityTarget!.textures.at(-1);\n material.frameLightCount.value = gridLights.length;\n material.frameMultipleScattering.value = ms;\n material.frameScatteringOctaves.value.copy(octaves);\n\n const directions = material.frameLightDirections.array as THREE.Vector3[];\n const colors = material.frameLightColors.array as THREE.Vector3[];\n\n for (let i = 0; i < gridLights.length; i++) {\n directions[i]!.fromArray(gridLights[i]!.direction);\n colors[i]!.fromArray(gridLights[i]!.color);\n }\n\n this.environmentGridMesh.layers.mask = camera.layers.mask;\n\n renderer.setRenderTarget(this.environmentGridTarget);\n renderer.render(this.environmentGridScene, camera);\n }\n\n // NOTE Draws the lat-long environment map with the rotation of the scene and intensity 1.0, then reads it.\n renderEnvironmentMap(renderer: RendererLike, scene: SceneLike): Promise<ArrayLike<number>> {\n if (!this.environmentMapTarget) {\n this.environmentMapTarget = createRenderTarget(frameEnvironmentMapWidth, frameEnvironmentMapHeight, {\n type: THREE.FloatType,\n minFilter: THREE.NearestFilter,\n magFilter: THREE.NearestFilter,\n });\n }\n\n this.copyEnvironment(this.environmentMapScene, scene);\n this.environmentMapScene.environmentIntensity = 1.0;\n this.environmentMapMaterial.setEnvironment(scene.environment);\n\n const currentRenderTarget = renderer.getRenderTarget();\n\n renderer.setRenderTarget(this.environmentMapTarget);\n renderer.render(this.environmentMapScene, this.environmentMapCamera);\n renderer.setRenderTarget(currentRenderTarget);\n\n return renderer.readRenderTargetPixelsAsync(this.environmentMapTarget, 0, 0, frameEnvironmentMapWidth, frameEnvironmentMapHeight) as unknown as Promise<ArrayLike<number>>;\n }\n\n // NOTE updatePool setup of the density pass: one instance for each slice of the volume\n readonly setupDensityEntry = (entry: PoolEntry, { frameVolume, volume }: FrameVolumeEntry<VDBFrameVolume>, camera: THREE.Camera): boolean => {\n if (!this.getFroxelRect(volume, camera, entry.rect)) {\n return false;\n }\n\n const { first, count } = this.getSliceRange(volume);\n\n entry.mesh.material = this.getDensityMaterial(frameVolume);\n (entry.mesh.material as VDBFrameDensityMaterial).setEnvironment(this.densityScene.environment);\n entry.frameVolume = frameVolume;\n entry.volume = volume;\n entry.sliceStart = first;\n entry.geometry.instanceCount = count;\n\n return true;\n };\n\n // NOTE updatePool setup of the shadow density pass: the voxels of the volume in one cascade\n readonly setupShadowEntry = (entry: PoolEntry, { caster, cascade }: { caster: FrameVolumeEntry<VDBFrameVolume>; cascade: number }): boolean => {\n const { frameVolume, volume } = caster;\n const range = this.getGridRange(volume, cascade);\n\n if (!range) {\n return false;\n }\n\n entry.mesh.material = this.getShadowDensityMaterial(frameVolume);\n entry.frameVolume = frameVolume;\n entry.volume = volume;\n entry.rect.copy(range.rect);\n entry.sliceStart = range.first;\n entry.geometry.instanceCount = range.count;\n\n return true;\n };\n\n // NOTE Pool entries are reused between frames. Unused entries are hidden.\n // Each entry takes the material of its volume and sets the volume uniforms before its draw.\n updatePool<T>(pool: PoolEntry[], scene: THREE.Scene, items: readonly T[], camera: THREE.Camera, setup: (entry: PoolEntry, item: T, camera: THREE.Camera) => boolean): void {\n let used = 0;\n\n for (let i = 0; i < items.length; i++) {\n if (!pool[used]) {\n const geometry = new THREE.InstancedBufferGeometry();\n geometry.setAttribute(\"position\", tileQuadPosition);\n\n const mesh = new THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>(geometry, new THREE.MeshBasicMaterial());\n mesh.frustumCulled = false;\n mesh.matrixAutoUpdate = false;\n\n const entry: PoolEntry = { mesh, geometry, frameVolume: null, volume: null, rect: new THREE.Vector4(), sliceStart: 0 };\n\n mesh.onBeforeRender = () => {\n const material = mesh.material as PassMaterial;\n\n setVolumeUniforms(material, entry.frameVolume!, entry.volume!);\n material.frameRect.value.copy(entry.rect);\n material.frameSliceStart.value = entry.sliceStart;\n };\n\n scene.add(mesh);\n pool[used] = entry;\n }\n\n const entry = pool[used]!;\n\n if (setup(entry, items[i]!, camera)) {\n entry.mesh.visible = true;\n entry.mesh.layers.mask = camera.layers.mask;\n used++;\n }\n }\n\n for (let i = used; i < pool.length; i++) {\n pool[i]!.mesh.visible = false;\n }\n }\n\n // NOTE Screen rectangle of the volume in froxel cells. Writes target. Returns false when it covers no cell.\n getFroxelRect(volume: FrameVolumeRecord, camera: THREE.Camera, target: THREE.Vector4): boolean {\n const { x: width, y: height } = this.froxelUniforms.froxelGrid.value;\n\n return getFroxelRect(volume, camera, width, height, target);\n }\n\n getCascadeCount(): number {\n return Math.min(frameMaxShadowCascades, Math.max(1, Math.round(this.settings.shadowCascades)));\n }\n\n // NOTE Shadow grid cascades of the casters (tools/frame/grid.ts). Returns false with no casters.\n updateGrid(casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"], camera: THREE.Camera): boolean {\n const { frameGridMin, frameGridSize, frameGridVoxel, frameGridCount, frameGridResolution } = this.gridUniforms;\n\n cameraPosition.setFromMatrixPosition(camera.matrixWorld);\n\n const count = vdbFrameGridCascades(\n casters.map((c) => c.volume.worldBox),\n cameraPosition,\n this.settings.shadowDistance,\n frameGridResolution.value as number,\n this.getCascadeCount(),\n frameGridMin.array as THREE.Vector3[],\n frameGridSize.array as THREE.Vector3[],\n frameGridVoxel.array as THREE.Vector3[],\n );\n\n if (count > 0) {\n frameGridCount.value = count;\n }\n\n return count > 0;\n }\n\n // NOTE Voxel rectangle and atlas slices of the volume in one shadow grid cascade\n getGridRange(volume: FrameVolumeRecord, cascade: number): { rect: THREE.Vector4; first: number; count: number } | null {\n const { frameGridMin, frameGridVoxel, frameGridResolution } = this.gridUniforms;\n const found = vdbFrameGridRange(volume.worldBox, cascade, frameGridResolution.value as number, frameGridMin.array as THREE.Vector3[], frameGridVoxel.array as THREE.Vector3[], this.gridRange);\n\n return found ? this.gridRange : null;\n }\n\n // NOTE A pooled light record of updateLights: (position, w type), (color, w spot cos), (spot direction, cos), falloff\n getLightRecord(list: LightList): LightRecord {\n if (list.length === list.entries.length) {\n list.entries.push({ position: new THREE.Vector4(), color: new THREE.Vector4(), spot: new THREE.Vector4(), falloff: new THREE.Vector2() });\n }\n\n const record = list.entries[list.length++]!;\n\n record.spot.set(0.0, 0.0, 0.0, 0.0);\n record.falloff.set(0.0, 0.0);\n\n return record;\n }\n\n // NOTE Light i of updateLights in slot order: directional, point, spot\n getSortedLight(index: number): LightRecord {\n const { directions, points, spots } = this.lightState;\n\n if (index < directions.length) {\n return directions.entries[index]!;\n }\n\n if (index < directions.length + points.length) {\n return points.entries[index - directions.length]!;\n }\n\n return spots.entries[index - directions.length - points.length]!;\n }\n\n // NOTE traverseVisible callback of updateLights. this.lightState holds the state of the current call.\n readonly visitLight = (object: THREE.Object3D): void => {\n const state = this.lightState;\n const light = object as THREE.Light & {\n isAmbientLight?: boolean;\n isHemisphereLight?: boolean;\n isLightProbe?: boolean;\n isDirectionalLight?: boolean;\n isSpotLight?: boolean;\n isPointLight?: boolean;\n groundColor?: THREE.Color;\n sh?: { coefficients: THREE.Vector3[] };\n target?: THREE.Object3D;\n angle?: number;\n penumbra?: number;\n distance?: number;\n decay?: number;\n };\n\n if (!light.isLight || !light.layers.test(state.camera!.layers)) {\n return;\n }\n\n const { frameAmbientColor, frameLightProbe, frameHemiSkyColor, frameHemiGroundColor, frameSkyDirection, frameHemiSkyColors, frameHemiGroundColors, frameHemiDirections } = this.lightUniforms;\n\n lightColor.copy(light.color).multiplyScalar(light.intensity);\n lightPosition.setFromMatrixPosition(light.matrixWorld);\n\n if (light.isAmbientLight) {\n frameAmbientColor.value.add(lightColor);\n } else if (light.isHemisphereLight) {\n const hemiCount = state.hemiCount;\n\n if (hemiCount < frameMaxHemisphereLights) {\n (frameHemiSkyColors.array as THREE.Vector3[])[hemiCount]!.set(lightColor.r, lightColor.g, lightColor.b);\n (frameHemiDirections.array as THREE.Vector3[])[hemiCount]!.copy(lightPosition).normalize();\n }\n\n frameHemiSkyColor.value.add(lightColor);\n lightColor.copy(light.groundColor!).multiplyScalar(light.intensity);\n frameHemiGroundColor.value.add(lightColor);\n\n if (hemiCount < frameMaxHemisphereLights) {\n (frameHemiGroundColors.array as THREE.Vector3[])[hemiCount]!.set(lightColor.r, lightColor.g, lightColor.b);\n }\n\n state.hemiCount++;\n\n if (!state.hasSky && lightPosition.lengthSq() > 0.0) {\n frameSkyDirection.value.copy(lightPosition).normalize();\n state.hasSky = true;\n }\n } else if (light.isLightProbe) {\n const { coefficients } = light.sh!;\n\n for (let i = 0; i < coefficients.length; i++) {\n (frameLightProbe.array as THREE.Vector3[])[i]!.addScaledVector(coefficients[i]!, light.intensity);\n }\n } else if (light.isDirectionalLight) {\n const record = this.getLightRecord(state.directions);\n\n lightTarget.setFromMatrixPosition(light.target!.matrixWorld);\n lightPosition.sub(lightTarget).normalize();\n record.position.set(lightPosition.x, lightPosition.y, lightPosition.z, 1.0);\n record.color.set(lightColor.r, lightColor.g, lightColor.b, 0.0);\n } else if (light.isSpotLight) {\n const record = this.getLightRecord(state.spots);\n\n lightTarget.setFromMatrixPosition(light.target!.matrixWorld);\n record.position.set(lightPosition.x, lightPosition.y, lightPosition.z, 3.0);\n record.color.set(lightColor.r, lightColor.g, lightColor.b, Math.cos(light.angle! * (1.0 - light.penumbra!)));\n lightTarget.subVectors(lightPosition, lightTarget).normalize();\n record.spot.set(lightTarget.x, lightTarget.y, lightTarget.z, Math.cos(light.angle!));\n record.falloff.set(light.distance!, light.decay!);\n } else if (light.isPointLight) {\n const record = this.getLightRecord(state.points);\n\n record.position.set(lightPosition.x, lightPosition.y, lightPosition.z, 2.0);\n record.color.set(lightColor.r, lightColor.g, lightColor.b, 0.0);\n record.falloff.set(light.distance!, light.decay!);\n }\n };\n\n // NOTE Scene lights into the light uniforms. Node materials in custom passes have no three.js light uniforms.\n // Shadow slots follow the light order: directional, point, spot.\n // NOTE Returns this.lightResult, used again in the next call.\n updateLights(scene: SceneLike, camera: THREE.Camera): LightResult {\n const u = this.lightUniforms;\n const state = this.lightState;\n const { directions, points, spots } = state;\n\n state.camera = camera;\n state.hemiCount = 0;\n state.hasSky = false;\n directions.length = 0;\n points.length = 0;\n spots.length = 0;\n\n u.frameAmbientColor.value.setRGB(0.0, 0.0, 0.0);\n u.frameHemiSkyColor.value.setRGB(0.0, 0.0, 0.0);\n u.frameHemiGroundColor.value.setRGB(0.0, 0.0, 0.0);\n u.frameSkyDirection.value.set(0.0, 1.0, 0.0);\n\n for (const v of u.frameLightProbe.array as THREE.Vector3[]) {\n v.set(0.0, 0.0, 0.0);\n }\n\n scene.traverseVisible(this.visitLight);\n state.camera = null;\n\n const { hemiCount } = state;\n const lightTotal = directions.length + points.length + spots.length;\n\n if ((lightTotal > frameMaxLights || hemiCount > frameMaxHemisphereLights) && !this.lightLimitWarned) {\n console.warn(`VDBFrameRenderer: too many lights. Only ${frameMaxLights} lights and ${frameMaxHemisphereLights} hemisphere lights are used.`);\n this.lightLimitWarned = true;\n }\n\n u.frameHemiCount.value = Math.min(hemiCount, frameMaxHemisphereLights);\n\n const count = Math.min(lightTotal, frameMaxLights);\n const positions = u.frameLightPositions.array as THREE.Vector4[];\n const colors = u.frameLightColors.array as THREE.Vector4[];\n const spotArray = u.frameLightSpots.array as THREE.Vector4[];\n const falloffs = u.frameLightFalloffs.array as THREE.Vector2[];\n\n for (let i = 0; i < count; i++) {\n const light = this.getSortedLight(i);\n\n positions[i]!.copy(light.position);\n colors[i]!.copy(light.color);\n spotArray[i]!.copy(light.spot);\n falloffs[i]!.copy(light.falloff);\n }\n\n u.frameLightCount.value = count;\n\n // NOTE Environment lights. 'volume' lighting marches all of them in each volume.\n const { environment } = this;\n const environmentCount = environment ? environment.count : 0;\n const environmentDirections = u.frameEnvironmentDirections.array as THREE.Vector3[];\n const environmentColors = u.frameEnvironmentColors.array as THREE.Vector3[];\n\n u.frameEnvironmentCount.value = environmentCount;\n\n for (let i = 0; i < environmentCount; i++) {\n environmentDirections[i]!.fromArray(environment!.directions[i]!);\n environmentColors[i]!.fromArray(environment!.colors[i]!);\n }\n\n // NOTE 'frame' lighting. Scene lights take the first shadow slots.\n // NOTE The dominant 'directional' environment light (light 0) takes the next free slot. Other environment lights go to the environment grid.\n const sceneShadowCount = Math.min(count, frameShadowLightSlots);\n const shadowLights = this.transmittanceMaterial.frameShadowLights.array as THREE.Vector4[];\n const frameLighting = this.isFrameLighting() && environmentCount > 0;\n const environmentLightCount =\n frameLighting &&\n environment!.mode === frameEnvironmentModes.directional &&\n sceneShadowCount < frameShadowLightSlots &&\n // NOTE Diffusion: all environment lights use the environment grid. Then both lights of an opposite pair get the same march.\n !isFrameDiffusion(this.multipleScatteringMode())\n ? 1\n : 0;\n const result = this.lightResult;\n const environmentGridLights = result.environmentGridLights;\n\n environmentGridLights.length = 0;\n\n for (let i = 0; i < sceneShadowCount; i++) {\n shadowLights[i]!.copy(this.getSortedLight(i).position);\n }\n\n if (environmentLightCount > 0) {\n shadowLights[sceneShadowCount]!.fromArray(environment!.directions[0]!).setW(1.0);\n }\n\n u.frameEnvironmentUnshadowed.value.set(0.0, 0.0, 0.0);\n\n if (frameLighting) {\n for (let i = environmentLightCount; i < environmentCount; i++) {\n const entries = this.environmentGridLightEntries;\n const index = environmentGridLights.length;\n\n if (index === entries.length) {\n entries.push({ direction: [], color: [] });\n }\n\n entries[index]!.direction = environment!.directions[i]!;\n entries[index]!.color = environment!.colors[i]!;\n environmentGridLights.push(entries[index]!);\n u.frameEnvironmentUnshadowed.value.add(environmentColors[i]!);\n }\n }\n\n u.frameEnvironmentUnshadowed.value.max(vector3.set(0.0, 0.0, 0.0));\n\n result.shadowLightCount = sceneShadowCount + environmentLightCount;\n result.environmentLightCount = environmentLightCount;\n result.environmentShadowSlot = sceneShadowCount;\n\n return result;\n }\n\n dispose(): void {\n // NOTE Puts back the shadow filter of each light; the new instance installs again on the next render\n this.volumeShadows.dispose();\n this.volumeShadows = new VDBFrameVolumeShadows(this);\n this.gridRenderId = -1;\n this.gridCamera = null;\n this.historyTargets.forEach((target) => target?.dispose());\n this.historyTargets = [null, null];\n this.historyValid = false;\n this.disposeSpectralTransmittanceTargets();\n\n for (const key of [\"atlasTarget\", \"densityTarget\", \"shadowDensityTarget\", \"transmittanceTarget\", \"environmentMapTarget\", \"environmentGridTarget\"] as const) {\n this[key]?.dispose();\n this[key] = null;\n }\n\n this.environmentLights = new VDBFrameEnvironmentLights((renderer, scene) => this.renderEnvironmentMap(renderer, scene));\n this.environment = null;\n this.environmentGridSignature = [];\n this.gridMipTargets.forEach((target) => target.dispose());\n this.gridMipTargets = [];\n this.gridMipSignature = [];\n\n for (const { mesh, geometry } of [...this.densityPool, ...this.shadowPool]) {\n mesh.parent?.remove(mesh);\n geometry.dispose();\n }\n\n this.densityPool = [];\n this.shadowPool = [];\n this.shadowDrawnVersion = -1;\n this.shadowDrawnTarget = null;\n\n for (const material of [this.integrateMaterial, this.lightingMaterial, this.transmittanceMaterial, this.temporalMaterial, this.densityClearMaterial, this.environmentMapMaterial, this.environmentGridMaterial, this.gridMipMaterial]) {\n material.dispose();\n }\n\n this.injectMesh.geometry.dispose();\n (this.injectMesh.material as THREE.Material).dispose();\n\n for (const mesh of [this.transmittanceMesh, this.environmentMapMesh, this.environmentGridMesh, this.gridMipMesh]) {\n mesh.geometry.dispose();\n }\n\n this.areaGeometry.dispose();\n this.cachedFrame = -1;\n this.cachedCamera = null;\n }\n}\n\n/** The scene fields the environment lights read (three's `Scene`). */\ninterface VDBFrameEnvironmentSceneFields {\n environment: THREE.Texture | null;\n environmentRotation: THREE.Euler;\n environmentIntensity: number;\n}\n\n/** frameShaderChunks.js L800–830 `setVolumeUniforms`: the values of one volume before its draw (inject, density or shadow density). */\nexport function setVolumeUniforms(material: { volumeUniforms: FrameVolumeUniforms; sourceUniforms: VDBVolumeUniforms }, frameVolume: VDBFrameVolume, volume: FrameVolumeRecord): void {\n const u = material.volumeUniforms;\n const s = material.sourceUniforms;\n\n // K5.9: a source.replace() (a sequence frame, a resize) reaches the uniforms without volume.updateSource()\n frameVolume.syncSource();\n u.frameViewToLocal.value.copy(volume.viewToLocal);\n u.frameLocalToView.value.copy(volume.localToView);\n u.frameWorldToLocal.value.copy(volume.worldToLocal);\n s.worldScale.value = volume.matrixWorld.getMaxScaleOnAxis();\n s.baseColor.value.copy(frameVolume.baseColor);\n u.frameScatterColor.value.copy(frameVolume.scatterColor);\n s.extinction.value = frameVolume.extinction;\n getFrameExtinctionSpectrum(frameVolume, u.frameExtinctionSpectrum.value);\n s.densityScale.value = frameVolume.getDensityScale();\n s.densityCutoff.value = frameVolume.densityCutoff;\n u.frameAbsorbance.value = frameVolume.absorbance;\n u.frameOpacity.value = frameVolume.opacity;\n s.emissiveIntensity.value = frameVolume.emissiveIntensity;\n s.temperatureRange.value.copy(frameVolume.temperatureRange);\n s.offset3D.value.copy(frameVolume.offset3D);\n s.wrap3D.value = frameVolume.wrap3D;\n // K5.9: the volume's phase overrides, else the renderer's settings (the 'volume' lighting phase; 'frame' lighting\n // draws its one phase from the settings in the lighting pass)\n const phase = frameVolume.getPhase();\n getFramePhase(phase, u.framePhase.value);\n getFramePhaseSpectrum(phase, u.framePhaseSpectrum.value);\n}\n\n/** Per three renderer shared instances (`vdbFrameRenderer(renderer)`). */\nconst sharedByRenderer = new WeakMap<object, VDBFrameRenderer>();\nlet shared: VDBFrameRenderer | null = null;\n\n/**\n * The shared {@link VDBFrameRenderer} that a `VDBFrameVolume` uses when you pass no `frameRenderer`.\n * Its `settings` are global to every volume that uses it (the froxel grid, shadows and scattering are\n * built once for all of them). Pass a three renderer to get the instance shared by that renderer only\n * (a WeakMap, so two three renderers never share targets or settings); with no argument you get the\n * one process-wide default. For volumes that need different settings, make your own\n * `new VDBFrameRenderer()` and pass it as `VDBFrameVolume({ frameRenderer })`.\n */\nexport function vdbFrameRenderer(renderer?: object): VDBFrameRenderer {\n if (renderer) {\n let r = sharedByRenderer.get(renderer);\n if (!r) sharedByRenderer.set(renderer, (r = new VDBFrameRenderer()));\n return r;\n }\n shared ??= new VDBFrameRenderer();\n return shared;\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NodeMaterial } from "three/webgpu";
|
|
2
|
+
import type { VDBTslNode } from "../grid-node.js";
|
|
3
|
+
import type { VDBThreeVolumeSource, VDBVolumeUniforms } from "../volume-source.js";
|
|
4
|
+
import { type FrameVolumeUniforms, type GridUniforms, type TileUniforms } from "./chunks.js";
|
|
5
|
+
export interface VDBFrameShadowDensityMaterialOptions {
|
|
6
|
+
gridUniforms: GridUniforms;
|
|
7
|
+
gridTileUniforms: TileUniforms;
|
|
8
|
+
source: VDBThreeVolumeSource;
|
|
9
|
+
sourceUniforms: VDBVolumeUniforms;
|
|
10
|
+
mipmaps: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class VDBFrameShadowDensityMaterial extends NodeMaterial {
|
|
13
|
+
readonly volumeUniforms: FrameVolumeUniforms;
|
|
14
|
+
readonly sourceUniforms: VDBVolumeUniforms;
|
|
15
|
+
readonly source: VDBThreeVolumeSource;
|
|
16
|
+
readonly gridUniforms: GridUniforms;
|
|
17
|
+
readonly frameRect: any;
|
|
18
|
+
readonly frameSliceStart: any;
|
|
19
|
+
mipmaps: boolean;
|
|
20
|
+
spectral: boolean;
|
|
21
|
+
constructor(o: VDBFrameShadowDensityMaterialOptions);
|
|
22
|
+
private readonly gridTileUniforms;
|
|
23
|
+
setMipmaps(mipmaps: boolean): void;
|
|
24
|
+
setSpectral(spectral: boolean): void;
|
|
25
|
+
rebuildNodes(): void;
|
|
26
|
+
createFragmentNode(gridTileUniforms: TileUniforms, spectralOutputs?: {
|
|
27
|
+
extinction: VDBTslNode;
|
|
28
|
+
absorption: VDBTslNode;
|
|
29
|
+
} | null): VDBTslNode;
|
|
30
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):
|
|
2
|
+
// src/three-openvdb/frame/webgpu/FrameShadowDensityMaterial.js L12–131 (K3.5: with the spectral
|
|
3
|
+
// outputs, setSpectral / rebuildNodes and the spectral branch L111–121).
|
|
4
|
+
// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).
|
|
5
|
+
// Changes: TypeScript; reads density only through `vdbVolumeNodes` (the VDBVolumeSource seam), so
|
|
6
|
+
// one material is built per volume source (as the inject material, DIVERGES V30); with the sparse
|
|
7
|
+
// source the grid voxel lod reads its coarse LOD (`'coarse-pyramid'`, D28). Divergences: DIVERGES.md (K3.3 rows), V23–V25, V30.
|
|
8
|
+
/**
|
|
9
|
+
* The shadow density pass of `'frame'` lighting (R1 §2 step 1): writes the extinction and the
|
|
10
|
+
* absorption of one volume into one cascade of the world shadow grid (RG half-float slice atlas,
|
|
11
|
+
* additive, so overlapping volumes sum; spectral: two RGBA targets, (extinction rgb, 0) and
|
|
12
|
+
* (absorption rgb, 0), with the volume's extinction spectrum and per-channel albedo). The source is read at the grid voxel's lod. Absorption
|
|
13
|
+
* limits multiple scattering in the shadow marches: dark volumes keep sharp shadows.
|
|
14
|
+
*/
|
|
15
|
+
import * as THREE from "three";
|
|
16
|
+
import { NodeMaterial } from "three/webgpu";
|
|
17
|
+
import * as TSL from "three/tsl";
|
|
18
|
+
import { vdbVolumeNodes } from "../volume-source.js";
|
|
19
|
+
import { createFrameVolumeUniforms, createGridNodes, frameFragCoord, frameShadowAbsorption, frameTileVertex } from "./chunks.js";
|
|
20
|
+
const { Discard, Fn, If, clamp, float, max, outputStruct, property, uniform, vec4 } = TSL;
|
|
21
|
+
// NOTE Writes the extinction and absorption of one volume into one cascade of the world-space shadow grid.
|
|
22
|
+
// NOTE One material per volume source. Pool meshes (one per cascade) set the rect and slices before each draw.
|
|
23
|
+
export class VDBFrameShadowDensityMaterial extends NodeMaterial {
|
|
24
|
+
volumeUniforms;
|
|
25
|
+
sourceUniforms;
|
|
26
|
+
source;
|
|
27
|
+
gridUniforms;
|
|
28
|
+
frameRect = uniform(new THREE.Vector4());
|
|
29
|
+
frameSliceStart = uniform(0.0);
|
|
30
|
+
mipmaps;
|
|
31
|
+
// NOTE Renderer settings.spectral: two targets, (extinction rgb, 0) and (absorption rgb, 0)
|
|
32
|
+
spectral = false;
|
|
33
|
+
constructor(o) {
|
|
34
|
+
super();
|
|
35
|
+
this.name = "VDBFrameShadowDensityMaterial";
|
|
36
|
+
this.volumeUniforms = createFrameVolumeUniforms();
|
|
37
|
+
this.sourceUniforms = o.sourceUniforms;
|
|
38
|
+
this.source = o.source;
|
|
39
|
+
this.gridUniforms = o.gridUniforms;
|
|
40
|
+
this.mipmaps = o.mipmaps;
|
|
41
|
+
this.vertexNode = frameTileVertex(o.gridTileUniforms, this.frameRect, this.frameSliceStart);
|
|
42
|
+
this.gridTileUniforms = o.gridTileUniforms;
|
|
43
|
+
this.rebuildNodes();
|
|
44
|
+
this.side = THREE.DoubleSide;
|
|
45
|
+
this.forceSinglePass = true;
|
|
46
|
+
this.depthTest = false;
|
|
47
|
+
this.depthWrite = false;
|
|
48
|
+
this.transparent = true;
|
|
49
|
+
this.blending = THREE.CustomBlending;
|
|
50
|
+
this.blendEquation = THREE.AddEquation;
|
|
51
|
+
this.blendSrc = THREE.OneFactor;
|
|
52
|
+
this.blendDst = THREE.OneFactor;
|
|
53
|
+
this.blendSrcAlpha = THREE.OneFactor;
|
|
54
|
+
this.blendDstAlpha = THREE.OneFactor;
|
|
55
|
+
}
|
|
56
|
+
gridTileUniforms;
|
|
57
|
+
// NOTE Mip sampling is in the shader only when the volume uses mipmaps
|
|
58
|
+
setMipmaps(mipmaps) {
|
|
59
|
+
if (mipmaps !== this.mipmaps) {
|
|
60
|
+
this.mipmaps = mipmaps;
|
|
61
|
+
this.rebuildNodes();
|
|
62
|
+
this.needsUpdate = true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
setSpectral(spectral) {
|
|
66
|
+
if (spectral !== this.spectral) {
|
|
67
|
+
this.spectral = spectral;
|
|
68
|
+
this.rebuildNodes();
|
|
69
|
+
this.needsUpdate = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
rebuildNodes() {
|
|
73
|
+
if (!this.spectral) {
|
|
74
|
+
this.colorNode = null;
|
|
75
|
+
this.outputNode = null;
|
|
76
|
+
this.fragmentNode = this.createFragmentNode(this.gridTileUniforms);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const extinction = property("vec4");
|
|
80
|
+
const absorption = property("vec4");
|
|
81
|
+
this.fragmentNode = null;
|
|
82
|
+
this.colorNode = this.createFragmentNode(this.gridTileUniforms, { extinction, absorption });
|
|
83
|
+
this.outputNode = outputStruct(extinction, absorption);
|
|
84
|
+
}
|
|
85
|
+
// NOTE spectralOutputs: { extinction, absorption } property nodes of the spectral targets. null: one target.
|
|
86
|
+
createFragmentNode(gridTileUniforms, spectralOutputs = null) {
|
|
87
|
+
const { gridUniforms, sourceUniforms } = this;
|
|
88
|
+
const volume = vdbVolumeNodes(this.source, sourceUniforms, { useMipmaps: this.mipmaps });
|
|
89
|
+
const grid = createGridNodes(gridUniforms);
|
|
90
|
+
const { frameWorldToLocal, frameAbsorbance, frameExtinctionSpectrum } = this.volumeUniforms;
|
|
91
|
+
const frameWorldScale = sourceUniforms.worldScale;
|
|
92
|
+
const { frameGridMin, frameGridSize, frameGridVoxel, frameGridCount } = gridUniforms;
|
|
93
|
+
return Fn(() => {
|
|
94
|
+
const cell = grid.getGridCell(frameFragCoord(gridTileUniforms.frameTargetSize));
|
|
95
|
+
const cascade = cell.cascade.toVar();
|
|
96
|
+
If(cascade.greaterThanEqual(frameGridCount), () => {
|
|
97
|
+
Discard();
|
|
98
|
+
});
|
|
99
|
+
const worldPosition = frameGridMin.element(cascade).add(cell.gridUvw.mul(frameGridSize.element(cascade)));
|
|
100
|
+
const localPosition = frameWorldToLocal.mul(vec4(worldPosition, 1.0)).xyz.toVar();
|
|
101
|
+
If(volume.insideBox(localPosition).not(), () => {
|
|
102
|
+
Discard();
|
|
103
|
+
});
|
|
104
|
+
// NOTE Absorbance scales the shadow of this volume, not its look from the camera
|
|
105
|
+
const voxel = frameGridVoxel.element(cascade);
|
|
106
|
+
const lod = volume.getLod(max(voxel.x, max(voxel.y, voxel.z)).div(frameWorldScale));
|
|
107
|
+
const extinction = volume.sampleExtinction(localPosition, lod).mul(frameAbsorbance).toVar();
|
|
108
|
+
If(extinction.lessThanEqual(0.0), () => {
|
|
109
|
+
Discard();
|
|
110
|
+
});
|
|
111
|
+
if (spectralOutputs) {
|
|
112
|
+
// NOTE Extinction and absorption of each channel. Absorption is the part that the albedo of the channel does not scatter.
|
|
113
|
+
const spectralExtinction = frameExtinctionSpectrum.mul(extinction).toVar();
|
|
114
|
+
const albedo = clamp(volume.sampleAlbedo(localPosition, lod), 0.0, 1.0);
|
|
115
|
+
spectralOutputs.extinction.assign(vec4(spectralExtinction, 0.0));
|
|
116
|
+
spectralOutputs.absorption.assign(vec4(spectralExtinction.mul(float(1.0).sub(albedo)), 0.0));
|
|
117
|
+
return vec4(0.0);
|
|
118
|
+
}
|
|
119
|
+
return vec4(extinction, frameShadowAbsorption(extinction, volume.sampleAlbedo(localPosition, lod)), 0.0, 0.0);
|
|
120
|
+
})();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=shadow-density-material.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadow-density-material.js","sourceRoot":"","sources":["../../../src/three/frame/shadow-density-material.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,kGAAkG;AAClG,2EAA2E;AAC3E,4GAA4G;AAC5G,kGAAkG;AAClG,kGAAkG;AAClG,gIAAgI;AAEhI;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,GAAG,MA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AAY,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;gBAExE,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC,CAAC;gBACjE,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;gBAE7F,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC;YAED,OAAO,IAAI,CAAC,UAAU,EAAE,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAChH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;CACF","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/FrameShadowDensityMaterial.js L12–131 (K3.5: with the spectral\n// outputs, setSpectral / rebuildNodes and the spectral branch L111–121).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: TypeScript; reads density only through `vdbVolumeNodes` (the VDBVolumeSource seam), so\n// one material is built per volume source (as the inject material, DIVERGES V30); with the sparse\n// source the grid voxel lod reads its coarse LOD (`'coarse-pyramid'`, D28). Divergences: DIVERGES.md (K3.3 rows), V23–V25, V30.\n\n/**\n * The shadow density pass of `'frame'` lighting (R1 §2 step 1): writes the extinction and the\n * absorption of one volume into one cascade of the world shadow grid (RG half-float slice atlas,\n * additive, so overlapping volumes sum; spectral: two RGBA targets, (extinction rgb, 0) and\n * (absorption rgb, 0), with the volume's extinction spectrum and per-channel albedo). The source is read at the grid voxel's lod. Absorption\n * limits multiple scattering in the shadow marches: dark volumes keep sharp shadows.\n */\n\nimport * as THREE from \"three\";\nimport { NodeMaterial } from \"three/webgpu\";\nimport * as TSL from \"three/tsl\";\nimport type { VDBTslNode } from \"../grid-node.js\";\nimport type { VDBThreeVolumeSource, VDBVolumeNodes, VDBVolumeUniforms } from \"../volume-source.js\";\nimport { vdbVolumeNodes } from \"../volume-source.js\";\nimport { createFrameVolumeUniforms, createGridNodes, frameFragCoord, frameShadowAbsorption, frameTileVertex, type FrameVolumeUniforms, type GridUniforms, type TileUniforms } from \"./chunks.js\";\n\nconst { Discard, Fn, If, clamp, float, max, outputStruct, property, uniform, vec4 } = TSL as unknown as Record<string, VDBTslNode>;\n\nexport interface VDBFrameShadowDensityMaterialOptions {\n gridUniforms: GridUniforms;\n gridTileUniforms: TileUniforms;\n source: VDBThreeVolumeSource;\n sourceUniforms: VDBVolumeUniforms;\n mipmaps: boolean;\n}\n\n// NOTE Writes the extinction and absorption of one volume into one cascade of the world-space shadow grid.\n// NOTE One material per volume source. Pool meshes (one per cascade) set the rect and slices before each draw.\nexport class VDBFrameShadowDensityMaterial extends NodeMaterial {\n readonly volumeUniforms: FrameVolumeUniforms;\n readonly sourceUniforms: VDBVolumeUniforms;\n readonly source: VDBThreeVolumeSource;\n readonly gridUniforms: GridUniforms;\n readonly frameRect = uniform(new THREE.Vector4());\n readonly frameSliceStart = uniform(0.0);\n mipmaps: boolean;\n // NOTE Renderer settings.spectral: two targets, (extinction rgb, 0) and (absorption rgb, 0)\n spectral = false;\n\n constructor(o: VDBFrameShadowDensityMaterialOptions) {\n super();\n\n this.name = \"VDBFrameShadowDensityMaterial\";\n this.volumeUniforms = createFrameVolumeUniforms();\n this.sourceUniforms = o.sourceUniforms;\n this.source = o.source;\n this.gridUniforms = o.gridUniforms;\n this.mipmaps = o.mipmaps;\n this.vertexNode = frameTileVertex(o.gridTileUniforms, this.frameRect, this.frameSliceStart);\n this.gridTileUniforms = o.gridTileUniforms;\n this.rebuildNodes();\n\n this.side = THREE.DoubleSide;\n this.forceSinglePass = true;\n this.depthTest = false;\n this.depthWrite = false;\n this.transparent = true;\n this.blending = THREE.CustomBlending;\n this.blendEquation = THREE.AddEquation;\n this.blendSrc = THREE.OneFactor;\n this.blendDst = THREE.OneFactor;\n this.blendSrcAlpha = THREE.OneFactor;\n this.blendDstAlpha = THREE.OneFactor;\n }\n\n private readonly gridTileUniforms: TileUniforms;\n\n // NOTE Mip sampling is in the shader only when the volume uses mipmaps\n setMipmaps(mipmaps: boolean): void {\n if (mipmaps !== this.mipmaps) {\n this.mipmaps = mipmaps;\n this.rebuildNodes();\n this.needsUpdate = true;\n }\n }\n\n setSpectral(spectral: boolean): void {\n if (spectral !== this.spectral) {\n this.spectral = spectral;\n this.rebuildNodes();\n this.needsUpdate = true;\n }\n }\n\n rebuildNodes(): void {\n if (!this.spectral) {\n this.colorNode = null;\n this.outputNode = null;\n this.fragmentNode = this.createFragmentNode(this.gridTileUniforms);\n\n return;\n }\n\n const extinction = property(\"vec4\");\n const absorption = property(\"vec4\");\n\n this.fragmentNode = null;\n this.colorNode = this.createFragmentNode(this.gridTileUniforms, { extinction, absorption });\n this.outputNode = outputStruct(extinction, absorption);\n }\n\n // NOTE spectralOutputs: { extinction, absorption } property nodes of the spectral targets. null: one target.\n createFragmentNode(gridTileUniforms: TileUniforms, spectralOutputs: { extinction: VDBTslNode; absorption: VDBTslNode } | null = null): VDBTslNode {\n const { gridUniforms, sourceUniforms } = this;\n const volume: VDBVolumeNodes = vdbVolumeNodes(this.source, sourceUniforms, { useMipmaps: this.mipmaps });\n const grid = createGridNodes(gridUniforms);\n const { frameWorldToLocal, frameAbsorbance, frameExtinctionSpectrum } = this.volumeUniforms;\n const frameWorldScale = sourceUniforms.worldScale;\n const { frameGridMin, frameGridSize, frameGridVoxel, frameGridCount } = gridUniforms;\n\n return Fn(() => {\n const cell = grid.getGridCell(frameFragCoord(gridTileUniforms.frameTargetSize));\n const cascade = cell.cascade.toVar();\n\n If(cascade.greaterThanEqual(frameGridCount), () => {\n Discard();\n });\n\n const worldPosition = frameGridMin.element(cascade).add(cell.gridUvw.mul(frameGridSize.element(cascade)));\n const localPosition = frameWorldToLocal.mul(vec4(worldPosition, 1.0)).xyz.toVar();\n\n If(volume.insideBox(localPosition).not(), () => {\n Discard();\n });\n\n // NOTE Absorbance scales the shadow of this volume, not its look from the camera\n const voxel = frameGridVoxel.element(cascade);\n const lod = volume.getLod(max(voxel.x, max(voxel.y, voxel.z)).div(frameWorldScale));\n const extinction = volume.sampleExtinction(localPosition, lod).mul(frameAbsorbance).toVar();\n\n If(extinction.lessThanEqual(0.0), () => {\n Discard();\n });\n\n if (spectralOutputs) {\n // NOTE Extinction and absorption of each channel. Absorption is the part that the albedo of the channel does not scatter.\n const spectralExtinction = frameExtinctionSpectrum.mul(extinction).toVar();\n const albedo = clamp(volume.sampleAlbedo(localPosition, lod), 0.0, 1.0);\n\n spectralOutputs.extinction.assign(vec4(spectralExtinction, 0.0));\n spectralOutputs.absorption.assign(vec4(spectralExtinction.mul(float(1.0).sub(albedo)), 0.0));\n\n return vec4(0.0);\n }\n\n return vec4(extinction, frameShadowAbsorption(extinction, volume.sampleAlbedo(localPosition, lod)), 0.0, 0.0);\n })();\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Vector3, Vector3Like } from "three";
|
|
2
|
+
/** Wavelengths in nm of the red, green and blue channels. Green is the reference (550 nm). */
|
|
3
|
+
export declare const frameSpectrumWavelengths: readonly [650, 550, 450];
|
|
4
|
+
/** Measured Ångström exponents (his VDB-116 research; Dubovik 2002, Bodhaine 1999). */
|
|
5
|
+
export declare const frameAngstromExponents: Readonly<Record<string, number>>;
|
|
6
|
+
/** A preset name of {@link frameAngstromExponents} or a number. Unknown names give 0 (grey). */
|
|
7
|
+
export declare const getFrameAngstromExponent: (value: string | number | undefined) => number;
|
|
8
|
+
/**
|
|
9
|
+
* Extinction scale of each channel: extinctionScale × (wavelength / 550)^−angstromExponent. Only
|
|
10
|
+
* spectral shaders read it (renderer `settings.spectral`); the grey passes keep it for the uniform layout.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getFrameExtinctionSpectrum: (frameVolume: {
|
|
13
|
+
extinctionScale?: Vector3Like;
|
|
14
|
+
angstromExponent?: string | number;
|
|
15
|
+
}, target: Vector3) => Vector3;
|
|
16
|
+
export declare const frameSpectralGroupCount = 4;
|
|
17
|
+
/** Groups in use for the number of light slots in use (0 to 6). */
|
|
18
|
+
export declare const getFrameSpectralGroups: (slotCount: number) => number;
|