@pmndrs/vdb 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +592 -2
- package/README.md +85 -37
- package/THIRD_PARTY_NOTICES.md +197 -29
- package/dist/core/compute/atlas.d.ts +10 -2
- package/dist/core/compute/atlas.js +6 -1
- package/dist/core/compute/atlas.js.map +1 -1
- package/dist/core/compute/index.d.ts +3 -3
- package/dist/core/compute/index.js +2 -2
- package/dist/core/compute/index.js.map +1 -1
- package/dist/core/compute/majorant-build.d.ts +45 -0
- package/dist/core/compute/majorant-build.js +193 -0
- package/dist/core/compute/majorant-build.js.map +1 -0
- package/dist/core/compute/multi-scale.d.ts +155 -0
- package/dist/core/compute/multi-scale.js +684 -0
- package/dist/core/compute/multi-scale.js.map +1 -0
- package/dist/core/compute/pyramid.d.ts +22 -7
- package/dist/core/compute/pyramid.js +22 -9
- package/dist/core/compute/pyramid.js.map +1 -1
- package/dist/core/compute/shared.d.ts +1 -0
- package/dist/core/compute/shared.js.map +1 -1
- package/dist/core/compute/stats.d.ts +10 -3
- package/dist/core/compute/stats.js +6 -1
- package/dist/core/compute/stats.js.map +1 -1
- package/dist/core/compute/value-transform.d.ts +8 -1
- package/dist/core/compute/value-transform.js +9 -3
- package/dist/core/compute/value-transform.js.map +1 -1
- package/dist/core/errors.d.ts +10 -0
- package/dist/core/errors.js +8 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/frame/emission.d.ts +85 -0
- package/dist/core/frame/emission.js +422 -0
- package/dist/core/frame/emission.js.map +1 -0
- package/dist/core/frame/environment.d.ts +47 -0
- package/dist/core/frame/environment.js +178 -0
- package/dist/core/frame/environment.js.map +1 -0
- package/dist/core/frame/index.d.ts +39 -0
- package/dist/core/frame/index.js +27 -0
- package/dist/core/frame/index.js.map +1 -0
- package/dist/core/frame/kernels.d.ts +115 -0
- package/dist/core/frame/kernels.js +496 -0
- package/dist/core/frame/kernels.js.map +1 -0
- package/dist/core/frame/limits.d.ts +67 -0
- package/dist/core/frame/limits.js +109 -0
- package/dist/core/frame/limits.js.map +1 -0
- package/dist/core/frame/phase.d.ts +17 -0
- package/dist/core/frame/phase.js +53 -0
- package/dist/core/frame/phase.js.map +1 -0
- package/dist/core/frame/pipelines.d.ts +49 -0
- package/dist/core/frame/pipelines.js +147 -0
- package/dist/core/frame/pipelines.js.map +1 -0
- package/dist/core/frame/renderer.d.ts +122 -0
- package/dist/core/frame/renderer.js +1712 -0
- package/dist/core/frame/renderer.js.map +1 -0
- package/dist/core/frame/resources.d.ts +71 -0
- package/dist/core/frame/resources.js +100 -0
- package/dist/core/frame/resources.js.map +1 -0
- package/dist/core/frame/scattering.d.ts +97 -0
- package/dist/core/frame/scattering.js +332 -0
- package/dist/core/frame/scattering.js.map +1 -0
- package/dist/core/frame/settings.d.ts +243 -0
- package/dist/core/frame/settings.js +67 -0
- package/dist/core/frame/settings.js.map +1 -0
- package/dist/core/frame/shadows.d.ts +55 -0
- package/dist/core/frame/shadows.js +460 -0
- package/dist/core/frame/shadows.js.map +1 -0
- package/dist/core/frame/types.d.ts +415 -0
- package/dist/core/frame/types.js +49 -0
- package/dist/core/frame/types.js.map +1 -0
- package/dist/core/frame/uniforms.d.ts +105 -0
- package/dist/core/frame/uniforms.js +276 -0
- package/dist/core/frame/uniforms.js.map +1 -0
- package/dist/core/frame/wgsl/chunks.d.ts +4 -0
- package/dist/core/frame/wgsl/chunks.js +728 -0
- package/dist/core/frame/wgsl/chunks.js.map +1 -0
- package/dist/core/frame/wgsl/emission.d.ts +82 -0
- package/dist/core/frame/wgsl/emission.js +353 -0
- package/dist/core/frame/wgsl/emission.js.map +1 -0
- package/dist/core/frame/wgsl/environment.d.ts +42 -0
- package/dist/core/frame/wgsl/environment.js +711 -0
- package/dist/core/frame/wgsl/environment.js.map +1 -0
- package/dist/core/frame/wgsl/gather.d.ts +55 -0
- package/dist/core/frame/wgsl/gather.js +850 -0
- package/dist/core/frame/wgsl/gather.js.map +1 -0
- package/dist/core/frame/wgsl/integrate.d.ts +78 -0
- package/dist/core/frame/wgsl/integrate.js +213 -0
- package/dist/core/frame/wgsl/integrate.js.map +1 -0
- package/dist/core/frame/wgsl/lighting.d.ts +103 -0
- package/dist/core/frame/wgsl/lighting.js +1636 -0
- package/dist/core/frame/wgsl/lighting.js.map +1 -0
- package/dist/core/frame/wgsl/occluders.d.ts +20 -0
- package/dist/core/frame/wgsl/occluders.js +95 -0
- package/dist/core/frame/wgsl/occluders.js.map +1 -0
- package/dist/core/frame/wgsl/resolve.d.ts +19 -0
- package/dist/core/frame/wgsl/resolve.js +205 -0
- package/dist/core/frame/wgsl/resolve.js.map +1 -0
- package/dist/core/frame/wgsl/shadows.d.ts +35 -0
- package/dist/core/frame/wgsl/shadows.js +328 -0
- package/dist/core/frame/wgsl/shadows.js.map +1 -0
- package/dist/core/half.d.ts +11 -0
- package/dist/core/half.js +22 -0
- package/dist/core/half.js.map +1 -0
- package/dist/core/index.d.ts +25 -3
- package/dist/core/index.js +23 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/internal.d.ts +17 -1
- package/dist/core/internal.js +18 -1
- package/dist/core/internal.js.map +1 -1
- package/dist/core/pool/image-header.d.ts +13 -2
- package/dist/core/pool/image-header.js +24 -5
- package/dist/core/pool/image-header.js.map +1 -1
- package/dist/core/pool/layout.d.ts +35 -1
- package/dist/core/pool/layout.js +51 -2
- package/dist/core/pool/layout.js.map +1 -1
- package/dist/core/pool/limits.d.ts +1 -0
- package/dist/core/pool/limits.js +1 -0
- package/dist/core/pool/limits.js.map +1 -1
- package/dist/core/pool/pool.d.ts +120 -15
- package/dist/core/pool/pool.js +255 -24
- package/dist/core/pool/pool.js.map +1 -1
- package/dist/core/reference/index.d.ts +6 -0
- package/dist/core/reference/index.js +7 -0
- package/dist/core/reference/index.js.map +1 -0
- package/dist/core/reference/renderer.d.ts +105 -0
- package/dist/core/reference/renderer.js +474 -0
- package/dist/core/reference/renderer.js.map +1 -0
- package/dist/core/reference/wgsl.d.ts +65 -0
- package/dist/core/reference/wgsl.js +803 -0
- package/dist/core/reference/wgsl.js.map +1 -0
- package/dist/{three → core}/sequence.d.ts +32 -2
- package/dist/{three → core}/sequence.js +24 -2
- package/dist/core/sequence.js.map +1 -0
- package/dist/core/source/brick-cache.d.ts +165 -0
- package/dist/core/source/brick-cache.js +627 -0
- package/dist/core/source/brick-cache.js.map +1 -0
- package/dist/core/source/dense-fill.d.ts +53 -0
- package/dist/core/source/dense-fill.js +377 -0
- package/dist/core/source/dense-fill.js.map +1 -0
- package/dist/core/source/dense.d.ts +33 -2
- package/dist/core/source/dense.js +121 -24
- package/dist/core/source/dense.js.map +1 -1
- package/dist/core/source/sparse-wgsl.d.ts +92 -0
- package/dist/core/source/sparse-wgsl.js +481 -0
- package/dist/core/source/sparse-wgsl.js.map +1 -0
- package/dist/core/source/sparse.d.ts +192 -0
- package/dist/core/source/sparse.js +762 -0
- package/dist/core/source/sparse.js.map +1 -0
- package/dist/core/source/types.d.ts +59 -2
- package/dist/core/source/types.js.map +1 -1
- package/dist/core/surface/index.d.ts +10 -0
- package/dist/core/surface/index.js +9 -0
- package/dist/core/surface/index.js.map +1 -0
- package/dist/core/surface/level-set-pass.d.ts +140 -0
- package/dist/core/surface/level-set-pass.js +291 -0
- package/dist/core/surface/level-set-pass.js.map +1 -0
- package/dist/core/surface/level-set-wgsl.d.ts +46 -0
- package/dist/core/surface/level-set-wgsl.js +99 -0
- package/dist/core/surface/level-set-wgsl.js.map +1 -0
- package/dist/core/surface/points.d.ts +109 -0
- package/dist/core/surface/points.js +226 -0
- package/dist/core/surface/points.js.map +1 -0
- package/dist/core/types.d.ts +12 -3
- package/dist/core/types.js +6 -2
- package/dist/core/types.js.map +1 -1
- package/dist/core/wgsl/api.d.ts +29 -5
- package/dist/core/wgsl/api.js +110 -27
- package/dist/core/wgsl/api.js.map +1 -1
- package/dist/core/wgsl/generate.d.ts +8 -0
- package/dist/core/wgsl/generate.js +195 -22
- package/dist/core/wgsl/generate.js.map +1 -1
- package/dist/core/wgsl/lean.d.ts +50 -0
- package/dist/core/wgsl/lean.js +327 -0
- package/dist/core/wgsl/lean.js.map +1 -0
- package/dist/core/wgsl/level-set.d.ts +5 -1
- package/dist/core/wgsl/level-set.js +11 -5
- package/dist/core/wgsl/level-set.js.map +1 -1
- package/dist/core/wgsl/majorant.d.ts +62 -0
- package/dist/core/wgsl/majorant.js +381 -0
- package/dist/core/wgsl/majorant.js.map +1 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +2 -2
- package/dist/core/wgsl/pnanovdb.chunks.generated.js +15 -12
- package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -1
- package/dist/core/wgsl/types.d.ts +97 -3
- package/dist/core/wgsl/types.js.map +1 -1
- package/dist/three/coarse-first.d.ts +53 -8
- package/dist/three/coarse-first.js +24 -6
- package/dist/three/coarse-first.js.map +1 -1
- package/dist/three/compute.d.ts +12 -2
- package/dist/three/compute.js +16 -6
- package/dist/three/compute.js.map +1 -1
- package/dist/three/device.d.ts +7 -0
- package/dist/three/device.js +3 -0
- package/dist/three/device.js.map +1 -1
- package/dist/three/frame/core-environment.d.ts +38 -0
- package/dist/three/frame/core-environment.js +154 -0
- package/dist/three/frame/core-environment.js.map +1 -0
- package/dist/three/frame/core-integrate-material.d.ts +34 -0
- package/dist/three/frame/core-integrate-material.js +162 -0
- package/dist/three/frame/core-integrate-material.js.map +1 -0
- package/dist/three/frame/core-occluders.d.ts +53 -0
- package/dist/three/frame/core-occluders.js +193 -0
- package/dist/three/frame/core-occluders.js.map +1 -0
- package/dist/three/frame/core-structs.d.ts +34 -0
- package/dist/three/frame/core-structs.js +61 -0
- package/dist/three/frame/core-structs.js.map +1 -0
- package/dist/three/frame/core-textures.d.ts +41 -0
- package/dist/three/frame/core-textures.js +114 -0
- package/dist/three/frame/core-textures.js.map +1 -0
- package/dist/three/frame/emission-light.d.ts +64 -114
- package/dist/three/frame/emission-light.js +188 -567
- package/dist/three/frame/emission-light.js.map +1 -1
- package/dist/three/frame/index.d.ts +11 -31
- package/dist/three/frame/index.js +9 -29
- package/dist/three/frame/index.js.map +1 -1
- package/dist/three/frame/medium.d.ts +12 -0
- package/dist/three/frame/medium.js.map +1 -1
- package/dist/three/frame/renderer.d.ts +58 -454
- package/dist/three/frame/renderer.js +409 -1427
- package/dist/three/frame/renderer.js.map +1 -1
- package/dist/three/frame/spectrum.d.ts +0 -14
- package/dist/three/frame/spectrum.js +2 -23
- package/dist/three/frame/spectrum.js.map +1 -1
- package/dist/three/frame/three-internals.d.ts +3 -8
- package/dist/three/frame/three-internals.js +13 -11
- package/dist/three/frame/three-internals.js.map +1 -1
- package/dist/three/frame/volume-shadows.d.ts +93 -107
- package/dist/three/frame/volume-shadows.js +278 -631
- package/dist/three/frame/volume-shadows.js.map +1 -1
- package/dist/three/frame/volume.d.ts +91 -33
- package/dist/three/frame/volume.js +63 -51
- package/dist/three/frame/volume.js.map +1 -1
- package/dist/three/grid-node.d.ts +34 -1
- package/dist/three/grid-node.js +36 -1
- package/dist/three/grid-node.js.map +1 -1
- package/dist/three/index.d.ts +20 -11
- package/dist/three/index.js +21 -12
- package/dist/three/index.js.map +1 -1
- package/dist/three/internal.d.ts +14 -8
- package/dist/three/internal.js +11 -7
- package/dist/three/internal.js.map +1 -1
- package/dist/three/level-set-material.d.ts +81 -8
- package/dist/three/level-set-material.js +162 -125
- package/dist/three/level-set-material.js.map +1 -1
- package/dist/three/level-set-physical-material.d.ts +154 -0
- package/dist/three/level-set-physical-material.js +253 -0
- package/dist/three/level-set-physical-material.js.map +1 -0
- package/dist/three/level-set-velocity.d.ts +94 -0
- package/dist/three/level-set-velocity.js +208 -0
- package/dist/three/level-set-velocity.js.map +1 -0
- package/dist/three/material.d.ts +141 -11
- package/dist/three/material.js +161 -18
- package/dist/three/material.js.map +1 -1
- package/dist/three/points.d.ts +60 -4
- package/dist/three/points.js +140 -9
- package/dist/three/points.js.map +1 -1
- package/dist/three/sparse-source.d.ts +49 -117
- package/dist/three/sparse-source.js +109 -580
- package/dist/three/sparse-source.js.map +1 -1
- package/dist/three/volume-source.d.ts +11 -156
- package/dist/three/volume-source.js +29 -272
- package/dist/three/volume-source.js.map +1 -1
- package/dist/tools/cpu/brick-atlas.d.ts +36 -0
- package/dist/tools/cpu/brick-atlas.js +129 -0
- package/dist/tools/cpu/brick-atlas.js.map +1 -0
- package/dist/tools/cpu/compute.d.ts +23 -4
- package/dist/tools/cpu/compute.js +35 -14
- package/dist/tools/cpu/compute.js.map +1 -1
- package/dist/tools/cpu/lean-reads.d.ts +81 -0
- package/dist/tools/cpu/lean-reads.js +262 -0
- package/dist/tools/cpu/lean-reads.js.map +1 -0
- package/dist/tools/cpu/level-set.d.ts +42 -3
- package/dist/tools/cpu/level-set.js +59 -7
- package/dist/tools/cpu/level-set.js.map +1 -1
- package/dist/tools/cpu/majorant.d.ts +265 -0
- package/dist/tools/cpu/majorant.js +541 -0
- package/dist/tools/cpu/majorant.js.map +1 -0
- package/dist/tools/cpu/march.d.ts +93 -2
- package/dist/tools/cpu/march.js +165 -14
- package/dist/tools/cpu/march.js.map +1 -1
- package/dist/tools/cpu/mesh-decimate.d.ts +124 -0
- package/dist/tools/cpu/mesh-decimate.js +1225 -0
- package/dist/tools/cpu/mesh-decimate.js.map +1 -0
- package/dist/tools/cpu/points.d.ts +29 -0
- package/dist/tools/cpu/points.js +38 -0
- package/dist/tools/cpu/points.js.map +1 -0
- package/dist/tools/cpu/read-value.d.ts +19 -6
- package/dist/tools/cpu/read-value.js +32 -17
- package/dist/tools/cpu/read-value.js.map +1 -1
- package/dist/tools/cpu/sample-trilinear.d.ts +17 -4
- package/dist/tools/cpu/sample-trilinear.js +19 -7
- package/dist/tools/cpu/sample-trilinear.js.map +1 -1
- package/dist/tools/cpu/stride-tables.d.ts +2 -2
- package/dist/tools/cpu/stride-tables.generated.d.ts +6 -5
- package/dist/tools/cpu/stride-tables.generated.js +7 -6
- package/dist/tools/cpu/stride-tables.generated.js.map +1 -1
- package/dist/tools/cpu/stride-tables.js +1 -1
- package/dist/tools/cpu/stride-tables.js.map +1 -1
- package/dist/tools/cpu/surface-nets.d.ts +90 -0
- package/dist/tools/cpu/surface-nets.js +597 -0
- package/dist/tools/cpu/surface-nets.js.map +1 -0
- package/dist/tools/errors.d.ts +9 -0
- package/dist/tools/errors.js +9 -0
- package/dist/tools/errors.js.map +1 -1
- package/dist/tools/frame/ambient.d.ts +98 -0
- package/dist/tools/frame/ambient.js +274 -0
- package/dist/tools/frame/ambient.js.map +1 -0
- package/dist/tools/frame/blackbody.d.ts +15 -0
- package/dist/tools/frame/blackbody.js +35 -0
- package/dist/tools/frame/blackbody.js.map +1 -1
- package/dist/tools/frame/brick-cache.d.ts +165 -0
- package/dist/tools/frame/brick-cache.js +326 -0
- package/dist/tools/frame/brick-cache.js.map +1 -0
- package/dist/tools/frame/emission.d.ts +9 -0
- package/dist/tools/frame/emission.js +9 -1
- package/dist/tools/frame/emission.js.map +1 -1
- package/dist/tools/frame/environment-gpu.d.ts +111 -0
- package/dist/tools/frame/environment-gpu.js +280 -0
- package/dist/tools/frame/environment-gpu.js.map +1 -0
- package/dist/tools/frame/environment.d.ts +3 -2
- package/dist/tools/frame/environment.js +8 -4
- package/dist/tools/frame/environment.js.map +1 -1
- package/dist/tools/frame/froxel.d.ts +58 -0
- package/dist/tools/frame/froxel.js +115 -0
- package/dist/tools/frame/froxel.js.map +1 -0
- package/dist/tools/frame/grid.d.ts +90 -0
- package/dist/tools/frame/grid.js +112 -13
- package/dist/tools/frame/grid.js.map +1 -1
- package/dist/tools/frame/index.d.ts +14 -0
- package/dist/tools/frame/index.js +45 -4
- package/dist/tools/frame/index.js.map +1 -1
- package/dist/tools/frame/medium.d.ts +16 -0
- package/dist/tools/frame/medium.js +3 -1
- package/dist/tools/frame/medium.js.map +1 -1
- package/dist/tools/frame/mie.d.ts +9 -0
- package/dist/tools/frame/mie.js +18 -0
- package/dist/tools/frame/mie.js.map +1 -1
- package/dist/tools/frame/mlp-nn.d.ts +36 -0
- package/dist/tools/frame/mlp-nn.js +159 -0
- package/dist/tools/frame/mlp-nn.js.map +1 -0
- package/dist/tools/frame/mlp-tza.d.ts +29 -0
- package/dist/tools/frame/mlp-tza.js +186 -0
- package/dist/tools/frame/mlp-tza.js.map +1 -0
- package/dist/tools/frame/mlp.d.ts +183 -0
- package/dist/tools/frame/mlp.js +434 -0
- package/dist/tools/frame/mlp.js.map +1 -0
- package/dist/tools/frame/ms-exit.d.ts +42 -0
- package/dist/tools/frame/ms-exit.js +90 -0
- package/dist/tools/frame/ms-exit.js.map +1 -0
- package/dist/tools/frame/multi-scale.d.ts +152 -0
- package/dist/tools/frame/multi-scale.js +302 -0
- package/dist/tools/frame/multi-scale.js.map +1 -0
- package/dist/tools/frame/neural-weights.d.ts +6 -5
- package/dist/tools/frame/neural-weights.js +234 -235
- package/dist/tools/frame/neural-weights.js.map +1 -1
- package/dist/tools/frame/neural.js +1 -1
- package/dist/tools/frame/neural.js.map +1 -1
- package/dist/tools/frame/occluders.d.ts +51 -0
- package/dist/tools/frame/occluders.js +72 -0
- package/dist/tools/frame/occluders.js.map +1 -0
- package/dist/tools/frame/pyramid-layout.d.ts +17 -0
- package/dist/tools/frame/pyramid-layout.js +47 -0
- package/dist/tools/frame/pyramid-layout.js.map +1 -1
- package/dist/tools/frame/shadows.d.ts +110 -0
- package/dist/tools/frame/shadows.js +286 -0
- package/dist/tools/frame/shadows.js.map +1 -1
- package/dist/tools/frame/sparse.d.ts +82 -0
- package/dist/tools/frame/sparse.js +242 -1
- package/dist/tools/frame/sparse.js.map +1 -1
- package/dist/tools/frame/spectral-stack.d.ts +159 -0
- package/dist/tools/frame/spectral-stack.js +391 -0
- package/dist/tools/frame/spectral-stack.js.map +1 -0
- package/dist/tools/frame/spectral.d.ts +21 -2
- package/dist/tools/frame/spectral.js +30 -8
- package/dist/tools/frame/spectral.js.map +1 -1
- package/dist/tools/frame/stack.d.ts +115 -0
- package/dist/tools/frame/stack.js +290 -0
- package/dist/tools/frame/stack.js.map +1 -0
- package/dist/tools/frame/view.d.ts +131 -0
- package/dist/tools/frame/view.js +337 -0
- package/dist/tools/frame/view.js.map +1 -0
- package/dist/tools/index.d.ts +66 -15
- package/dist/tools/index.js +55 -11
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/internal.d.ts +58 -17
- package/dist/tools/internal.js +65 -11
- package/dist/tools/internal.js.map +1 -1
- package/dist/tools/nanovdb/build-from-vdb.d.ts +11 -2
- package/dist/tools/nanovdb/build-from-vdb.js +10 -2
- package/dist/tools/nanovdb/build-from-vdb.js.map +1 -1
- package/dist/tools/nanovdb/bytes.d.ts +17 -4
- package/dist/tools/nanovdb/bytes.js +46 -3
- package/dist/tools/nanovdb/bytes.js.map +1 -1
- package/dist/tools/nanovdb/coarse-first.d.ts +19 -3
- package/dist/tools/nanovdb/coarse-first.js +7 -1
- package/dist/tools/nanovdb/coarse-first.js.map +1 -1
- package/dist/tools/nanovdb/half.d.ts +22 -0
- package/dist/tools/nanovdb/half.js +73 -0
- package/dist/tools/nanovdb/half.js.map +1 -0
- package/dist/tools/nanovdb/index.d.ts +3 -1
- package/dist/tools/nanovdb/index.js +2 -1
- package/dist/tools/nanovdb/index.js.map +1 -1
- package/dist/tools/nanovdb/inspect.d.ts +10 -1
- package/dist/tools/nanovdb/inspect.js +8 -1
- package/dist/tools/nanovdb/inspect.js.map +1 -1
- package/dist/tools/nanovdb/leaf-codec.d.ts +35 -1
- package/dist/tools/nanovdb/leaf-codec.js +40 -4
- package/dist/tools/nanovdb/leaf-codec.js.map +1 -1
- package/dist/tools/nanovdb/quantize.d.ts +39 -10
- package/dist/tools/nanovdb/quantize.js +96 -44
- package/dist/tools/nanovdb/quantize.js.map +1 -1
- package/dist/tools/nanovdb/resample.d.ts +20 -3
- package/dist/tools/nanovdb/resample.js +20 -7
- package/dist/tools/nanovdb/resample.js.map +1 -1
- package/dist/tools/nanovdb/serialize.d.ts +34 -3
- package/dist/tools/nanovdb/serialize.js +51 -7
- package/dist/tools/nanovdb/serialize.js.map +1 -1
- package/dist/tools/nanovdb/stats.d.ts +34 -5
- package/dist/tools/nanovdb/stats.js +87 -11
- package/dist/tools/nanovdb/stats.js.map +1 -1
- package/dist/tools/nanovdb/transform.d.ts +4 -0
- package/dist/tools/nanovdb/transform.js +3 -0
- package/dist/tools/nanovdb/transform.js.map +1 -1
- package/dist/tools/nanovdb/tree.d.ts +14 -3
- package/dist/tools/nanovdb/tree.js +25 -13
- package/dist/tools/nanovdb/tree.js.map +1 -1
- package/dist/tools/nanovdb/write-nvdb.d.ts +47 -12
- package/dist/tools/nanovdb/write-nvdb.js +108 -28
- package/dist/tools/nanovdb/write-nvdb.js.map +1 -1
- package/dist/tools/nvdb-file.d.ts +77 -7
- package/dist/tools/nvdb-file.js +177 -20
- package/dist/tools/nvdb-file.js.map +1 -1
- package/dist/tools/nvdb-stream.d.ts +23 -7
- package/dist/tools/nvdb-stream.js +78 -34
- package/dist/tools/nvdb-stream.js.map +1 -1
- package/dist/tools/reference/analytic.d.ts +41 -0
- package/dist/tools/reference/analytic.js +95 -0
- package/dist/tools/reference/analytic.js.map +1 -0
- package/dist/tools/reference/environment.d.ts +62 -0
- package/dist/tools/reference/environment.js +154 -0
- package/dist/tools/reference/environment.js.map +1 -0
- package/dist/tools/reference/index.d.ts +12 -0
- package/dist/tools/reference/index.js +13 -0
- package/dist/tools/reference/index.js.map +1 -0
- package/dist/tools/reference/media.d.ts +14 -0
- package/dist/tools/reference/media.js +30 -0
- package/dist/tools/reference/media.js.map +1 -0
- package/dist/tools/reference/rng.d.ts +20 -0
- package/dist/tools/reference/rng.js +30 -0
- package/dist/tools/reference/rng.js.map +1 -0
- package/dist/tools/reference/scene.d.ts +312 -0
- package/dist/tools/reference/scene.js +169 -0
- package/dist/tools/reference/scene.js.map +1 -0
- package/dist/tools/reference/tables.d.ts +98 -0
- package/dist/tools/reference/tables.js +264 -0
- package/dist/tools/reference/tables.js.map +1 -0
- package/dist/tools/reference/trace.d.ts +160 -0
- package/dist/tools/reference/trace.js +497 -0
- package/dist/tools/reference/trace.js.map +1 -0
- package/dist/tools/vdb/blosc-write.d.ts +43 -0
- package/dist/tools/vdb/blosc-write.js +197 -0
- package/dist/tools/vdb/blosc-write.js.map +1 -0
- package/dist/tools/vdb/blosc.d.ts +35 -5
- package/dist/tools/vdb/blosc.js +82 -26
- package/dist/tools/vdb/blosc.js.map +1 -1
- package/dist/tools/vdb/blosclz.d.ts +33 -0
- package/dist/tools/vdb/blosclz.js +112 -0
- package/dist/tools/vdb/blosclz.js.map +1 -0
- package/dist/tools/vdb/byte-reader.d.ts +13 -3
- package/dist/tools/vdb/byte-reader.js +26 -4
- package/dist/tools/vdb/byte-reader.js.map +1 -1
- package/dist/tools/vdb/compression.d.ts +13 -5
- package/dist/tools/vdb/compression.js +13 -2
- package/dist/tools/vdb/compression.js.map +1 -1
- package/dist/tools/vdb/grid.js +8 -2
- package/dist/tools/vdb/grid.js.map +1 -1
- package/dist/tools/vdb/index.d.ts +2 -1
- package/dist/tools/vdb/index.js.map +1 -1
- package/dist/tools/vdb/lz4.d.ts +30 -0
- package/dist/tools/vdb/lz4.js +228 -0
- package/dist/tools/vdb/lz4.js.map +1 -0
- package/dist/tools/vdb/metadata.js +1 -1
- package/dist/tools/vdb/metadata.js.map +1 -1
- package/dist/tools/vdb/parse.d.ts +24 -2
- package/dist/tools/vdb/parse.js +102 -32
- package/dist/tools/vdb/parse.js.map +1 -1
- package/dist/tools/vdb/point-render-data.d.ts +49 -1
- package/dist/tools/vdb/point-render-data.js +91 -11
- package/dist/tools/vdb/point-render-data.js.map +1 -1
- package/dist/tools/vdb/points.d.ts +26 -0
- package/dist/tools/vdb/points.js +46 -5
- package/dist/tools/vdb/points.js.map +1 -1
- package/dist/tools/vdb/types.d.ts +59 -2
- package/dist/tools/vdb/types.js.map +1 -1
- package/dist/tools/wvdb/bake.d.ts +38 -9
- package/dist/tools/wvdb/bake.js +63 -13
- package/dist/tools/wvdb/bake.js.map +1 -1
- package/dist/tools/wvdb/dense.d.ts +80 -1
- package/dist/tools/wvdb/dense.js +67 -8
- package/dist/tools/wvdb/dense.js.map +1 -1
- package/dist/tools/wvdb/format.d.ts +59 -0
- package/dist/tools/wvdb/format.js +3 -0
- package/dist/tools/wvdb/format.js.map +1 -1
- package/dist/tools/wvdb/index.d.ts +1 -0
- package/dist/tools/wvdb/index.js +1 -0
- package/dist/tools/wvdb/index.js.map +1 -1
- package/dist/tools/wvdb/level-set.d.ts +10 -2
- package/dist/tools/wvdb/level-set.js.map +1 -1
- package/dist/tools/wvdb/nanovdb.d.ts +6 -1
- package/dist/tools/wvdb/nanovdb.js +5 -1
- package/dist/tools/wvdb/nanovdb.js.map +1 -1
- package/dist/tools/wvdb/partial.d.ts +74 -0
- package/dist/tools/wvdb/partial.js +233 -0
- package/dist/tools/wvdb/partial.js.map +1 -0
- package/dist/tools/wvdb/read.d.ts +77 -1
- package/dist/tools/wvdb/read.js +30 -7
- package/dist/tools/wvdb/read.js.map +1 -1
- package/dist/tools/wvdb/write.d.ts +23 -1
- package/dist/tools/wvdb/write.js +8 -1
- package/dist/tools/wvdb/write.js.map +1 -1
- package/package.json +2 -1
- package/vendor/VENDOR.md +21 -6
- package/vendor/pnanovdb.wgsl +52 -14
- package/dist/three/frame/blackbody.d.ts +0 -42
- package/dist/three/frame/blackbody.js +0 -74
- package/dist/three/frame/blackbody.js.map +0 -1
- package/dist/three/frame/chunks.d.ts +0 -157
- package/dist/three/frame/chunks.js +0 -559
- package/dist/three/frame/chunks.js.map +0 -1
- package/dist/three/frame/density-material.d.ts +0 -53
- package/dist/three/frame/density-material.js +0 -353
- package/dist/three/frame/density-material.js.map +0 -1
- package/dist/three/frame/environment-grid-material.d.ts +0 -21
- package/dist/three/frame/environment-grid-material.js +0 -184
- package/dist/three/frame/environment-grid-material.js.map +0 -1
- package/dist/three/frame/environment-material.d.ts +0 -22
- package/dist/three/frame/environment-material.js +0 -87
- package/dist/three/frame/environment-material.js.map +0 -1
- package/dist/three/frame/grid-mip-material.d.ts +0 -12
- package/dist/three/frame/grid-mip-material.js +0 -61
- package/dist/three/frame/grid-mip-material.js.map +0 -1
- package/dist/three/frame/inject-material.d.ts +0 -56
- package/dist/three/frame/inject-material.js +0 -424
- package/dist/three/frame/inject-material.js.map +0 -1
- package/dist/three/frame/integrate-material.d.ts +0 -26
- package/dist/three/frame/integrate-material.js +0 -198
- package/dist/three/frame/integrate-material.js.map +0 -1
- package/dist/three/frame/layout.d.ts +0 -34
- package/dist/three/frame/layout.js +0 -48
- package/dist/three/frame/layout.js.map +0 -1
- package/dist/three/frame/lighting-material.d.ts +0 -41
- package/dist/three/frame/lighting-material.js +0 -257
- package/dist/three/frame/lighting-material.js.map +0 -1
- package/dist/three/frame/lights.d.ts +0 -11
- package/dist/three/frame/lights.js +0 -16
- package/dist/three/frame/lights.js.map +0 -1
- package/dist/three/frame/neural.d.ts +0 -14
- package/dist/three/frame/neural.js +0 -105
- package/dist/three/frame/neural.js.map +0 -1
- package/dist/three/frame/phase.d.ts +0 -44
- package/dist/three/frame/phase.js +0 -80
- package/dist/three/frame/phase.js.map +0 -1
- package/dist/three/frame/shadow-density-material.d.ts +0 -30
- package/dist/three/frame/shadow-density-material.js +0 -123
- package/dist/three/frame/shadow-density-material.js.map +0 -1
- package/dist/three/frame/temporal-material.d.ts +0 -29
- package/dist/three/frame/temporal-material.js +0 -152
- package/dist/three/frame/temporal-material.js.map +0 -1
- package/dist/three/frame/transmittance-material.d.ts +0 -31
- package/dist/three/frame/transmittance-material.js +0 -315
- package/dist/three/frame/transmittance-material.js.map +0 -1
- package/dist/three/frame/view.d.ts +0 -103
- package/dist/three/frame/view.js +0 -296
- package/dist/three/frame/view.js.map +0 -1
- package/dist/three/frame/volume-shadow-material.d.ts +0 -36
- package/dist/three/frame/volume-shadow-material.js +0 -128
- package/dist/three/frame/volume-shadow-material.js.map +0 -1
- package/dist/three/sequence.js.map +0 -1
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { VDBTslNode } from "../grid-node.js";
|
|
2
|
-
import type { VDBThreeVolumeSource, VDBVolumeNodesOptions, VDBVolumeUniforms } from "../volume-source.js";
|
|
3
|
-
import { type FrameVolumeUniforms, type FroxelUniforms, type LightUniforms, type TileUniforms } from "./chunks.js";
|
|
4
|
-
import { VDBFrameEnvironmentMaterial } from "./environment-material.js";
|
|
5
|
-
export interface VDBFrameInjectMaterialOptions {
|
|
6
|
-
froxelUniforms: FroxelUniforms;
|
|
7
|
-
froxelTileUniforms: TileUniforms;
|
|
8
|
-
lightUniforms: LightUniforms;
|
|
9
|
-
/** The volume source (dense, or sparse since K3.2: the same node shape). */
|
|
10
|
-
source: VDBThreeVolumeSource;
|
|
11
|
-
/** The source's live uniforms (`vdbVolumeUniforms`). */
|
|
12
|
-
sourceUniforms: VDBVolumeUniforms;
|
|
13
|
-
/** Sample the source's mip levels (his shaders built with mipmaps). */
|
|
14
|
-
mipmaps: boolean;
|
|
15
|
-
/** Emission colour hook of `vdbVolumeNodes` (DIVERGES V24). */
|
|
16
|
-
emissionColor?: VDBVolumeNodesOptions["emissionColor"];
|
|
17
|
-
/** Skip empty space in the shadow march when the source can (`skipEmpty`; sparse). Default false (K3.2 A/B). */
|
|
18
|
-
hdda?: boolean;
|
|
19
|
-
/** Renderer settings.spectral (K3.5). Default false. */
|
|
20
|
-
spectral?: boolean;
|
|
21
|
-
/** Compile the hemisphere-light loop (the scene has hemisphere lights). Default false. */
|
|
22
|
-
hemisphereLights?: boolean;
|
|
23
|
-
/** Compile the environment-light loop (the renderer has 'directional' / SH environment lights). Default false. */
|
|
24
|
-
environmentLights?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare class VDBFrameInjectMaterial extends VDBFrameEnvironmentMaterial {
|
|
27
|
-
readonly froxelUniforms: FroxelUniforms;
|
|
28
|
-
readonly lightUniforms: LightUniforms;
|
|
29
|
-
readonly volumeUniforms: FrameVolumeUniforms;
|
|
30
|
-
readonly sourceUniforms: VDBVolumeUniforms;
|
|
31
|
-
readonly source: VDBThreeVolumeSource;
|
|
32
|
-
readonly frameLights: any;
|
|
33
|
-
readonly frameShadowSteps: any;
|
|
34
|
-
readonly frameMultipleScattering: any;
|
|
35
|
-
readonly frameScatteringOctaves: any;
|
|
36
|
-
readonly frameTwoSided: any;
|
|
37
|
-
readonly frameCameraMatrixWorld: any;
|
|
38
|
-
readonly frameRect: any;
|
|
39
|
-
readonly frameSliceStart: any;
|
|
40
|
-
mipmaps: boolean;
|
|
41
|
-
hdda: boolean;
|
|
42
|
-
spectral: boolean;
|
|
43
|
-
hemisphereLights: boolean;
|
|
44
|
-
environmentLights: boolean;
|
|
45
|
-
readonly emissionColor: VDBVolumeNodesOptions["emissionColor"];
|
|
46
|
-
constructor(o: VDBFrameInjectMaterialOptions);
|
|
47
|
-
setMipmaps(mipmaps: boolean): void;
|
|
48
|
-
setHdda(hdda: boolean): void;
|
|
49
|
-
setSpectral(spectral: boolean): void;
|
|
50
|
-
setLightTerms(hemisphereLights: boolean, environmentLights: boolean): void;
|
|
51
|
-
rebuildNodes(): void;
|
|
52
|
-
createFragmentNode(spectralOutputs?: {
|
|
53
|
-
color: VDBTslNode;
|
|
54
|
-
alpha: VDBTslNode;
|
|
55
|
-
} | null): VDBTslNode;
|
|
56
|
-
}
|
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):
|
|
2
|
-
// src/three-openvdb/frame/webgpu/FrameInjectMaterial.js L59–101 (constructor, blending),
|
|
3
|
-
// L142–284 (froxel pre-integration, shadow march), L395–398 (ambient), L453–532 (scene lights,
|
|
4
|
-
// radiance, premultiplied output); K3.4: L73–76 (octave and two-sided uniforms), L270–277 (octave
|
|
5
|
-
// march depth and transmittance), L488–512 (the two-sided back march, frameShadowedLight with octaves);
|
|
6
|
-
// K3.5: L80–81 and L103–130 (spectral flag, setSpectral, rebuildNodes and the two spectral outputs),
|
|
7
|
-
// L200–229 (the spectral pre-integration), L286–348 (the spectral shadow march), L350–383
|
|
8
|
-
// (totalTransmittance, the diffusion pair, isotropicTransmittance), L385–451 (the light-probe,
|
|
9
|
-
// environment and hemisphere terms), L499–532 (frameSpectralShadowedLight, the spectral outputs).
|
|
10
|
-
// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).
|
|
11
|
-
// Changes: TypeScript; reads density only through `vdbVolumeNodes` (the VDBVolumeSource seam), so
|
|
12
|
-
// one material is built per volume source; with a sparse source the shadow march skips empty space
|
|
13
|
-
// through the source's HDDA query (K3.2, same lattice, same values; also for the spectral march); the
|
|
14
|
-
// hemisphere and environment-light loops are compiled in only when the scene has such lights, and isotropic
|
|
15
|
-
// light marches each direction once (his code marches the front direction again when diffusion is off):
|
|
16
|
-
// the same values, a smaller shader (the HDDA march is large on SwiftShader).
|
|
17
|
-
// Divergences: DIVERGES.md (K3.1, K3.2, K3.4 and K3.5 rows), V23–V25.
|
|
18
|
-
/**
|
|
19
|
-
* `'volume'` lighting (R1 §2): lights one volume in each froxel with a shadow march through that
|
|
20
|
-
* volume's own source. Other volumes do not cast shadows on it. The renderer draws it once per
|
|
21
|
-
* volume, one instance per slice of the volume's froxel rectangle. Lights: ambient and the light
|
|
22
|
-
* probe (along the outward normal), the scene environment (environment lights with one march each,
|
|
23
|
-
* or the PMREM irradiance along the outward direction), hemisphere lights (sky and ground marches),
|
|
24
|
-
* and the directional, point and spot lights, each gated by the volume's `lights` bitmask. Diffusion
|
|
25
|
-
* multiple scattering gives isotropic light the two-sided total of a march pair (white furnace).
|
|
26
|
-
* Spectral (K3.5): per-channel extinction (the volume's spectrum), albedo and multiple scattering,
|
|
27
|
-
* two atlas targets.
|
|
28
|
-
*/
|
|
29
|
-
import * as THREE from "three";
|
|
30
|
-
import * as TSL from "three/tsl";
|
|
31
|
-
import { vdbVolumeNodes } from "../volume-source.js";
|
|
32
|
-
import { createFrameVolumeUniforms, frameDistanceFade, frameFragCoord, frameGetFroxel, frameIsotropicDiffusion, frameMeanComponent, frameNoise, frameShadowAbsorption, frameShadowMarchDepth, frameShadowStep, frameShadowTotal, frameShadowTransmittance, frameShadowedLight, frameSpectralShadowDepths, frameSpectralShadowTotal, frameSpectralShadowTransmittance, frameSpectralShadowUnit, frameSpectralShadowedLight, frameTileVertex, frameTwoSidedDiffusion, getBoxSteps, getFroxelLod, getSampledLod, maxComponent, minComponent, } from "./chunks.js";
|
|
33
|
-
import { VDBFrameEnvironmentMaterial } from "./environment-material.js";
|
|
34
|
-
import { vdbFrameLights } from "./lights.js";
|
|
35
|
-
// NOTE TSL's r187 typings narrow node types; the ported shader code is written against untyped nodes,
|
|
36
|
-
// as volume-source.ts is (VDBTslNode).
|
|
37
|
-
const { Break, Continue, Discard, Fn, If, Loop, ceil, dot, exp, float, getShIrradianceAt, int, length, mat3, max, min, mix, normalize, outputStruct, property, select, smoothstep, uniform, vec2, vec3, vec4 } = TSL;
|
|
38
|
-
// NOTE Lights one volume in each froxel, with a shadow march in this volume. Other volumes do not cast shadows.
|
|
39
|
-
// NOTE The renderer draws it one time for each volume, with the uniforms of that volume.
|
|
40
|
-
export class VDBFrameInjectMaterial extends VDBFrameEnvironmentMaterial {
|
|
41
|
-
froxelUniforms;
|
|
42
|
-
lightUniforms;
|
|
43
|
-
volumeUniforms;
|
|
44
|
-
sourceUniforms;
|
|
45
|
-
source;
|
|
46
|
-
frameLights = uniform(0, "int");
|
|
47
|
-
frameShadowSteps = uniform(32, "int");
|
|
48
|
-
// NOTE Multiple scattering of this volume (phase.ts). 0.0 is single scattering.
|
|
49
|
-
frameMultipleScattering = uniform(0.0);
|
|
50
|
-
// NOTE Scattering octaves of the renderer settings (phase.ts). Count 0 is off.
|
|
51
|
-
frameScatteringOctaves = uniform(new THREE.Vector4());
|
|
52
|
-
// NOTE multipleScattering 'two-sided' (phase.ts): scene light shadows also march away from the light
|
|
53
|
-
frameTwoSided = uniform(0.0);
|
|
54
|
-
frameCameraMatrixWorld = uniform(new THREE.Matrix4());
|
|
55
|
-
// NOTE The froxel rectangle and the slices of the volume of this draw. One instance for each slice.
|
|
56
|
-
frameRect = uniform(new THREE.Vector4());
|
|
57
|
-
frameSliceStart = uniform(0.0);
|
|
58
|
-
mipmaps;
|
|
59
|
-
hdda;
|
|
60
|
-
// NOTE Renderer settings.spectral: extinction and multiple scattering of each channel, two atlas targets
|
|
61
|
-
spectral;
|
|
62
|
-
// NOTE Light loops compiled in (setLightTerms). Without them the loop counts are 0, so the result is the same.
|
|
63
|
-
hemisphereLights;
|
|
64
|
-
environmentLights;
|
|
65
|
-
emissionColor;
|
|
66
|
-
constructor(o) {
|
|
67
|
-
super();
|
|
68
|
-
this.name = "VDBFrameInjectMaterial";
|
|
69
|
-
this.froxelUniforms = o.froxelUniforms;
|
|
70
|
-
this.lightUniforms = o.lightUniforms;
|
|
71
|
-
this.volumeUniforms = createFrameVolumeUniforms();
|
|
72
|
-
this.source = o.source;
|
|
73
|
-
this.sourceUniforms = o.sourceUniforms;
|
|
74
|
-
this.mipmaps = o.mipmaps;
|
|
75
|
-
this.hdda = o.hdda ?? false;
|
|
76
|
-
this.spectral = o.spectral ?? false;
|
|
77
|
-
this.hemisphereLights = o.hemisphereLights ?? false;
|
|
78
|
-
this.environmentLights = o.environmentLights ?? false;
|
|
79
|
-
this.emissionColor = o.emissionColor;
|
|
80
|
-
this.vertexNode = frameTileVertex(o.froxelTileUniforms, this.frameRect, this.frameSliceStart);
|
|
81
|
-
this.rebuildNodes();
|
|
82
|
-
this.side = THREE.DoubleSide;
|
|
83
|
-
this.forceSinglePass = true;
|
|
84
|
-
this.transparent = true;
|
|
85
|
-
this.depthTest = false;
|
|
86
|
-
this.depthWrite = false;
|
|
87
|
-
// NOTE Premultiplied "over" blend. Overlapping volumes in one froxel multiply their transmittance.
|
|
88
|
-
this.blending = THREE.CustomBlending;
|
|
89
|
-
this.blendEquation = THREE.AddEquation;
|
|
90
|
-
this.blendSrc = THREE.OneFactor;
|
|
91
|
-
this.blendDst = THREE.OneMinusSrcAlphaFactor;
|
|
92
|
-
this.blendSrcAlpha = THREE.OneFactor;
|
|
93
|
-
this.blendDstAlpha = THREE.OneMinusSrcAlphaFactor;
|
|
94
|
-
}
|
|
95
|
-
// NOTE Mip sampling is in the shader only when the volume uses mipmaps
|
|
96
|
-
setMipmaps(mipmaps) {
|
|
97
|
-
if (mipmaps !== this.mipmaps) {
|
|
98
|
-
this.mipmaps = mipmaps;
|
|
99
|
-
this.environmentNodes = [];
|
|
100
|
-
this.rebuildNodes();
|
|
101
|
-
this.needsUpdate = true;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
// NOTE HDDA skipping is compiled in only when on (K3.2 A/B)
|
|
105
|
-
setHdda(hdda) {
|
|
106
|
-
if (hdda !== this.hdda) {
|
|
107
|
-
this.hdda = hdda;
|
|
108
|
-
this.environmentNodes = [];
|
|
109
|
-
this.rebuildNodes();
|
|
110
|
-
this.needsUpdate = true;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
setSpectral(spectral) {
|
|
114
|
-
if (spectral !== this.spectral) {
|
|
115
|
-
this.spectral = spectral;
|
|
116
|
-
this.environmentNodes = [];
|
|
117
|
-
this.rebuildNodes();
|
|
118
|
-
this.needsUpdate = true;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
// NOTE Compile the hemisphere and environment-light loops only for scenes that have those lights
|
|
122
|
-
setLightTerms(hemisphereLights, environmentLights) {
|
|
123
|
-
if (hemisphereLights !== this.hemisphereLights || environmentLights !== this.environmentLights) {
|
|
124
|
-
this.hemisphereLights = hemisphereLights;
|
|
125
|
-
this.environmentLights = environmentLights;
|
|
126
|
-
this.environmentNodes = [];
|
|
127
|
-
this.rebuildNodes();
|
|
128
|
-
this.needsUpdate = true;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
// NOTE Spectral: atlas target 0 is (color, green alpha), target 1 is (red alpha, blue alpha, 0, green alpha).
|
|
132
|
-
// NOTE Both targets blend with the green alpha (w of each output).
|
|
133
|
-
rebuildNodes() {
|
|
134
|
-
if (!this.spectral) {
|
|
135
|
-
this.colorNode = null;
|
|
136
|
-
this.outputNode = null;
|
|
137
|
-
this.fragmentNode = this.createFragmentNode();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const injectColor = property("vec4");
|
|
141
|
-
const injectAlpha = property("vec4");
|
|
142
|
-
this.fragmentNode = null;
|
|
143
|
-
this.colorNode = this.createFragmentNode({ color: injectColor, alpha: injectAlpha });
|
|
144
|
-
this.outputNode = outputStruct(injectColor, injectAlpha);
|
|
145
|
-
}
|
|
146
|
-
// NOTE spectralOutputs: { color, alpha } property nodes of the spectral targets. null: one target.
|
|
147
|
-
createFragmentNode(spectralOutputs = null) {
|
|
148
|
-
const spectral = spectralOutputs !== null;
|
|
149
|
-
const { froxelUniforms, lightUniforms, volumeUniforms, sourceUniforms, source } = this;
|
|
150
|
-
const { froxelGrid, froxelSubSteps, froxelAtlasSize, frameJitter } = froxelUniforms;
|
|
151
|
-
const { frameAmbientColor, frameLightProbe, frameHemiCount, frameHemiSkyColors, frameHemiGroundColors, frameHemiDirections, frameLightCount, frameLightPositions, frameLightColors, frameLightSpots, frameEnvironmentCount, frameEnvironmentDirections, frameEnvironmentColors } = lightUniforms;
|
|
152
|
-
const { frameViewToLocal, frameLocalToView, frameWorldToLocal, frameOpacity, frameAbsorbance, frameScatterColor, frameExtinctionSpectrum } = volumeUniforms;
|
|
153
|
-
const frameWorldScale = sourceUniforms.worldScale;
|
|
154
|
-
const volume = vdbVolumeNodes(source, sourceUniforms, { useMipmaps: this.mipmaps, ...(this.emissionColor ? { emissionColor: this.emissionColor } : {}) });
|
|
155
|
-
const skipEmpty = this.hdda && volume.skipEmpty ? volume.skipEmpty.bind(volume) : null;
|
|
156
|
-
const useLights = (flag) => this.frameLights.bitAnd(int(flag)).notEqual(0);
|
|
157
|
-
return Fn(() => {
|
|
158
|
-
const fragCoord = frameFragCoord(froxelAtlasSize).toVar();
|
|
159
|
-
const froxel = frameGetFroxel(froxelUniforms, fragCoord);
|
|
160
|
-
If(froxel.slice.greaterThanEqual(froxelGrid.z), () => {
|
|
161
|
-
Discard();
|
|
162
|
-
});
|
|
163
|
-
const viewNear = froxel.viewNear.toVar();
|
|
164
|
-
const viewFar = froxel.viewFar.toVar();
|
|
165
|
-
const localNear = frameViewToLocal.mul(vec4(viewNear, 1.0)).xyz.toVar();
|
|
166
|
-
const localFar = frameViewToLocal.mul(vec4(viewFar, 1.0)).xyz.toVar();
|
|
167
|
-
const boxSegment = volume.boxSegment(localNear, localFar).toVar();
|
|
168
|
-
If(boxSegment.x.greaterThanEqual(boxSegment.y), () => {
|
|
169
|
-
Discard();
|
|
170
|
-
});
|
|
171
|
-
const segment = boxSegment.y.sub(boxSegment.x).toVar();
|
|
172
|
-
const widthLod = getFroxelLod(froxelUniforms, froxel, volume, float(0.0), frameWorldScale);
|
|
173
|
-
const sampledLod = getSampledLod(sourceUniforms, source.channels.mask, widthLod, this.mipmaps);
|
|
174
|
-
const steps = getBoxSteps(volume, localNear, localFar, segment, sampledLod, froxelSubSteps);
|
|
175
|
-
const subStepCount = float(steps);
|
|
176
|
-
const subStepLength = length(viewFar.sub(viewNear)).mul(segment).div(subStepCount).toVar();
|
|
177
|
-
const lod = max(widthLod, volume.getLod(subStepLength.div(frameWorldScale))).toVar();
|
|
178
|
-
// NOTE Pre-integrate the slice along the view ray. Light the visibility-weighted mean position, not the froxel center.
|
|
179
|
-
// NOTE Spectral: transmittance of each channel. The visible position uses the mean of the channels.
|
|
180
|
-
const transmittance = (spectral ? vec3(1.0) : float(1.0)).toVar();
|
|
181
|
-
const visibleWeight = float(0.0).toVar();
|
|
182
|
-
const visibleTSum = float(0.0).toVar();
|
|
183
|
-
const jitter = frameNoise(frameJitter, fragCoord).toVar();
|
|
184
|
-
Loop({ start: int(0), end: steps, type: "int", condition: "<" }, ({ i }) => {
|
|
185
|
-
const t = boxSegment.x.add(segment.mul(float(i).add(jitter).div(subStepCount))).toVar();
|
|
186
|
-
const opticalDepth = volume
|
|
187
|
-
.sampleExtinction(mix(localNear, localFar, t), lod)
|
|
188
|
-
.mul(frameOpacity)
|
|
189
|
-
.mul(frameDistanceFade(froxelUniforms, mix(viewNear, viewFar, t)))
|
|
190
|
-
.mul(subStepLength);
|
|
191
|
-
const stepTransmittance = exp((spectral ? frameExtinctionSpectrum.mul(opticalDepth) : opticalDepth).negate()).toVar();
|
|
192
|
-
const stepWeight = transmittance.mul(float(1.0).sub(stepTransmittance));
|
|
193
|
-
const weight = (spectral ? frameMeanComponent(stepWeight) : stepWeight).toVar();
|
|
194
|
-
visibleWeight.addAssign(weight);
|
|
195
|
-
visibleTSum.addAssign(weight.mul(t));
|
|
196
|
-
transmittance.mulAssign(stepTransmittance);
|
|
197
|
-
});
|
|
198
|
-
const alpha = (spectral ? vec3(1.0) : float(1.0)).sub(transmittance).toVar();
|
|
199
|
-
If(visibleWeight.lessThanEqual(0.0).or((spectral ? maxComponent(alpha) : alpha).lessThanEqual(1e-5)), () => {
|
|
200
|
-
Discard();
|
|
201
|
-
});
|
|
202
|
-
const localPosition = mix(localNear, localFar, visibleTSum.div(visibleWeight)).toVar();
|
|
203
|
-
const viewPosition = frameLocalToView.mul(vec4(localPosition, 1.0)).xyz;
|
|
204
|
-
const worldPosition = this.frameCameraMatrixWorld.mul(vec4(viewPosition, 1.0)).xyz.toVar();
|
|
205
|
-
const worldToLocalDirection = mat3(frameWorldToLocal);
|
|
206
|
-
const rayDirection = normalize(mat3(this.frameCameraMatrixWorld).mul(viewFar.sub(viewNear))).toVar();
|
|
207
|
-
const shadowNoise = frameNoise(frameJitter, fragCoord.add(vec2(17.0, 31.0))).toVar();
|
|
208
|
-
const albedo = volume.sampleAlbedo(localPosition, lod).toVar();
|
|
209
|
-
// NOTE The shadow sample loop of both marches. sample(extinction) adds one sample (extinction × world step × absorbance);
|
|
210
|
-
// stop() is the march depth test after it. The HDDA variant (K3.2) jumps over the runs of samples the source proves empty.
|
|
211
|
-
const marchSamples = (direction, marchDistance, localStep, stepLod, stepScale, sample, stop) => {
|
|
212
|
-
if (skipEmpty) {
|
|
213
|
-
// K3.2: the same sample lattice t_k = localStep (k + noise), but runs of samples the source proves
|
|
214
|
-
// empty (exactly 0 extinction, so 0 depth) are jumped over. Positions are computed, not accumulated.
|
|
215
|
-
// The source is asked only at the start and after a zero sample, so dense runs pay nothing for it.
|
|
216
|
-
const k = int(0).toVar();
|
|
217
|
-
const cellEnd = float(-1.0).toVar();
|
|
218
|
-
const lastZero = float(1.0).toVar();
|
|
219
|
-
const tEnd = marchDistance.add(localStep).toVar();
|
|
220
|
-
Loop(k.lessThan(this.frameShadowSteps), () => {
|
|
221
|
-
const t = localStep.mul(float(k).add(shadowNoise)).toVar();
|
|
222
|
-
If(t.greaterThanEqual(cellEnd).and(lastZero.greaterThan(0.5)), () => {
|
|
223
|
-
const span = skipEmpty(localPosition, direction, t, tEnd, stepLod).toVar();
|
|
224
|
-
cellEnd.assign(span.y);
|
|
225
|
-
If(span.x.greaterThan(t), () => {
|
|
226
|
-
k.assign(max(k.add(1), int(ceil(span.x.div(localStep).sub(shadowNoise)))));
|
|
227
|
-
Continue();
|
|
228
|
-
});
|
|
229
|
-
});
|
|
230
|
-
const extinction = volume.sampleExtinction(localPosition.add(direction.mul(t)), stepLod).mul(stepScale).toVar();
|
|
231
|
-
lastZero.assign(select(extinction.lessThanEqual(0.0), float(1.0), float(0.0)));
|
|
232
|
-
sample(extinction);
|
|
233
|
-
If(stop(), () => {
|
|
234
|
-
Break();
|
|
235
|
-
});
|
|
236
|
-
k.addAssign(1);
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
const probe = localPosition.add(direction.mul(localStep).mul(shadowNoise)).toVar();
|
|
241
|
-
Loop(this.frameShadowSteps, () => {
|
|
242
|
-
const extinction = volume.sampleExtinction(probe, stepLod).mul(stepScale).toVar();
|
|
243
|
-
sample(extinction);
|
|
244
|
-
If(stop(), () => {
|
|
245
|
-
Break();
|
|
246
|
-
});
|
|
247
|
-
probe.addAssign(direction.mul(localStep));
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
// NOTE Shadow march inside this volume only. Call in the Fn body.
|
|
252
|
-
// NOTE Returns (direct, total, reduced depth, effective depth). The absorption uses the albedo at the lit position.
|
|
253
|
-
const volumeTransmittance = (localDirection, maxLocalDistance) => {
|
|
254
|
-
const result = vec4(1.0, 1.0, 0.0, 0.0).toVar();
|
|
255
|
-
If(frameAbsorbance.greaterThan(0.0).and(this.frameShadowSteps.greaterThan(0)), () => {
|
|
256
|
-
const direction = normalize(localDirection).toVar();
|
|
257
|
-
const marchDistance = min(volume.boxExit(localPosition, direction), maxLocalDistance).toVar();
|
|
258
|
-
If(marchDistance.greaterThan(0.0), () => {
|
|
259
|
-
const localStep = marchDistance.div(float(this.frameShadowSteps)).toVar();
|
|
260
|
-
const stepLod = max(lod, volume.getLod(localStep)).toVar();
|
|
261
|
-
const worldStep = localStep.mul(length(mat3(frameLocalToView).mul(direction)));
|
|
262
|
-
const stepScale = worldStep.mul(frameAbsorbance).toVar();
|
|
263
|
-
const depths = vec3(0.0).toVar();
|
|
264
|
-
marchSamples(direction, marchDistance, localStep, stepLod, stepScale, (extinction) => {
|
|
265
|
-
depths.addAssign(frameShadowStep(extinction, frameShadowAbsorption(extinction, albedo), this.frameMultipleScattering));
|
|
266
|
-
}, () => frameShadowMarchDepth(depths, this.frameMultipleScattering, this.frameScatteringOctaves).greaterThan(8.0));
|
|
267
|
-
const shadow = frameShadowTransmittance(depths, this.frameMultipleScattering, this.frameScatteringOctaves);
|
|
268
|
-
result.assign(vec4(shadow.x, shadow.y, depths.z, depths.y));
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
return result;
|
|
272
|
-
};
|
|
273
|
-
// NOTE Spectral shadow march. One volume has one spectrum, so the march sums one optical depth.
|
|
274
|
-
// Then the depths of each channel are linear in it (frameSpectralShadowDepths).
|
|
275
|
-
// Returns { x: direct, y: total, z: reduced depth, w: effective depth }, vec3 values.
|
|
276
|
-
const shadowUnit = spectral ? frameSpectralShadowUnit(frameExtinctionSpectrum, albedo, this.frameMultipleScattering) : null;
|
|
277
|
-
const spectralVolumeTransmittance = (localDirection, maxLocalDistance) => {
|
|
278
|
-
const direct = vec3(1.0).toVar();
|
|
279
|
-
const total = vec3(1.0).toVar();
|
|
280
|
-
const reduced = vec3(0.0).toVar();
|
|
281
|
-
const effective = vec3(0.0).toVar();
|
|
282
|
-
If(frameAbsorbance.greaterThan(0.0).and(this.frameShadowSteps.greaterThan(0)), () => {
|
|
283
|
-
const direction = normalize(localDirection).toVar();
|
|
284
|
-
const marchDistance = min(volume.boxExit(localPosition, direction), maxLocalDistance).toVar();
|
|
285
|
-
If(marchDistance.greaterThan(0.0), () => {
|
|
286
|
-
const localStep = marchDistance.div(float(this.frameShadowSteps)).toVar();
|
|
287
|
-
const stepLod = max(lod, volume.getLod(localStep)).toVar();
|
|
288
|
-
const worldStep = localStep.mul(length(mat3(frameLocalToView).mul(direction)));
|
|
289
|
-
const stepScale = worldStep.mul(frameAbsorbance).toVar();
|
|
290
|
-
const opticalDepth = float(0.0).toVar();
|
|
291
|
-
marchSamples(direction, marchDistance, localStep, stepLod, stepScale, (extinction) => {
|
|
292
|
-
opticalDepth.addAssign(extinction);
|
|
293
|
-
},
|
|
294
|
-
// NOTE Stop when all channels are dark
|
|
295
|
-
() => minComponent(frameShadowMarchDepth(frameSpectralShadowDepths(shadowUnit, opticalDepth), this.frameMultipleScattering, this.frameScatteringOctaves)).greaterThan(8.0));
|
|
296
|
-
const depths = frameSpectralShadowDepths(shadowUnit, opticalDepth);
|
|
297
|
-
const shadow = frameSpectralShadowTransmittance(depths, this.frameMultipleScattering, this.frameScatteringOctaves);
|
|
298
|
-
direct.assign(shadow.x);
|
|
299
|
-
total.assign(shadow.y);
|
|
300
|
-
reduced.assign(depths.z);
|
|
301
|
-
effective.assign(depths.y);
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
return { x: direct, y: total, z: reduced, w: effective };
|
|
305
|
-
};
|
|
306
|
-
const march = spectral ? spectralVolumeTransmittance : volumeTransmittance;
|
|
307
|
-
// NOTE Isotropic light (no phase): total transmittance of a march's total (y) value
|
|
308
|
-
const shadowTotal = (total) => (spectral ? frameSpectralShadowTotal(total, this.frameScatteringOctaves, albedo) : frameShadowTotal(total, this.frameScatteringOctaves));
|
|
309
|
-
// NOTE Diffusion: two-sided totals of isotropic light (frameIsotropicDiffusion) of a direction and the opposite one.
|
|
310
|
-
// Spectral: vec3 values, one for each channel. Call in the Fn body.
|
|
311
|
-
const diffusion = this.frameMultipleScattering.greaterThan(0.0);
|
|
312
|
-
const isotropicValue = () => (spectral ? vec3(1.0) : float(1.0)).toVar();
|
|
313
|
-
// NOTE Total transmittance of isotropic light from one direction ({ x }) and the opposite one ({ y }), each marched once.
|
|
314
|
-
// Diffusion: the two-sided totals of the pair. Single scattering or octaves: the total of each march. Call in the Fn body.
|
|
315
|
-
const isotropicPair = (localDirection, withOpposite) => {
|
|
316
|
-
const front = march(localDirection, float(1e6));
|
|
317
|
-
const x = isotropicValue();
|
|
318
|
-
const y = isotropicValue();
|
|
319
|
-
if (withOpposite) {
|
|
320
|
-
const back = march(localDirection.negate(), float(1e6));
|
|
321
|
-
If(diffusion, () => {
|
|
322
|
-
x.assign(frameIsotropicDiffusion(front.z, back.z, front.w));
|
|
323
|
-
y.assign(frameIsotropicDiffusion(back.z, front.z, back.w));
|
|
324
|
-
}).Else(() => {
|
|
325
|
-
x.assign(shadowTotal(front.y));
|
|
326
|
-
y.assign(shadowTotal(back.y));
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
else {
|
|
330
|
-
If(diffusion, () => {
|
|
331
|
-
const back = march(localDirection.negate(), float(1e6));
|
|
332
|
-
x.assign(frameIsotropicDiffusion(front.z, back.z, front.w));
|
|
333
|
-
}).Else(() => {
|
|
334
|
-
x.assign(shadowTotal(front.y));
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
return { x, y };
|
|
338
|
-
};
|
|
339
|
-
const outwardNormal = select(length(localPosition).greaterThan(1e-4), normalize(mat3(this.frameCameraMatrixWorld).mul(mat3(frameLocalToView).mul(localPosition))), vec3(0.0, 1.0, 0.0)).toVar();
|
|
340
|
-
const irradiance = vec3(0.0).toVar();
|
|
341
|
-
If(useLights(vdbFrameLights.useAmbientLights), () => {
|
|
342
|
-
irradiance.addAssign(frameAmbientColor);
|
|
343
|
-
irradiance.addAssign(getShIrradianceAt(outwardNormal, frameLightProbe));
|
|
344
|
-
});
|
|
345
|
-
// NOTE Outward direction of the scene environment (no environment lights). Diffusion: the outward and the inward
|
|
346
|
-
// irradiance, each with its two-sided total. Uniform light then gives E.
|
|
347
|
-
const outwardEnvironment = () => {
|
|
348
|
-
if (this.environment) {
|
|
349
|
-
const outwardDirection = worldToLocalDirection.mul(outwardNormal).toVar();
|
|
350
|
-
const front = march(outwardDirection, float(1e6));
|
|
351
|
-
If(diffusion, () => {
|
|
352
|
-
const back = march(outwardDirection.negate(), float(1e6));
|
|
353
|
-
irradiance.addAssign(this.environmentIrradiance(outwardNormal).mul(frameIsotropicDiffusion(front.z, back.z, front.w).mul(0.5)));
|
|
354
|
-
irradiance.addAssign(this.environmentIrradiance(outwardNormal.negate()).mul(frameIsotropicDiffusion(back.z, front.z, back.w).mul(0.5)));
|
|
355
|
-
}).Else(() => {
|
|
356
|
-
irradiance.addAssign(this.environmentIrradiance(outwardNormal).mul(shadowTotal(front.y)));
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
// NOTE Environment lights replace the outward direction: one shadow march for each light, no phase
|
|
361
|
-
If(useLights(vdbFrameLights.useEnvironment), () => {
|
|
362
|
-
if (this.environmentLights) {
|
|
363
|
-
If(frameEnvironmentCount.greaterThan(0), () => {
|
|
364
|
-
const environment = vec3(0.0).toVar();
|
|
365
|
-
Loop(frameEnvironmentCount, ({ i }) => {
|
|
366
|
-
const direction = worldToLocalDirection.mul(frameEnvironmentDirections.element(i)).toVar();
|
|
367
|
-
environment.addAssign(frameEnvironmentColors.element(i).mul(isotropicPair(direction, false).x));
|
|
368
|
-
});
|
|
369
|
-
irradiance.addAssign(max(environment, vec3(0.0)));
|
|
370
|
-
}).Else(outwardEnvironment);
|
|
371
|
-
}
|
|
372
|
-
else {
|
|
373
|
-
outwardEnvironment();
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
if (this.hemisphereLights) {
|
|
377
|
-
If(useLights(vdbFrameLights.useHemisphereLights), () => {
|
|
378
|
-
Loop(frameHemiCount, ({ i }) => {
|
|
379
|
-
const upDirection = worldToLocalDirection.mul(frameHemiDirections.element(i)).toVar();
|
|
380
|
-
// NOTE Diffusion: sky and ground are an opposite pair, two-sided totals
|
|
381
|
-
const pair = isotropicPair(upDirection, true);
|
|
382
|
-
irradiance.addAssign(frameHemiSkyColors.element(i).mul(0.5).mul(pair.x));
|
|
383
|
-
irradiance.addAssign(frameHemiGroundColors.element(i).mul(0.5).mul(pair.y));
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
// NOTE Point and spot lights have no distance falloff
|
|
388
|
-
Loop(frameLightCount, ({ i }) => {
|
|
389
|
-
const position = frameLightPositions.element(i).toVar();
|
|
390
|
-
const color = frameLightColors.element(i).toVar();
|
|
391
|
-
const spot = frameLightSpots.element(i).toVar();
|
|
392
|
-
const isDirectional = position.w.lessThan(1.5);
|
|
393
|
-
const isSpot = position.w.greaterThan(2.5);
|
|
394
|
-
const enabled = select(isDirectional, useLights(vdbFrameLights.useDirectionalLights), select(isSpot, useLights(vdbFrameLights.useSpotLights), useLights(vdbFrameLights.usePointLights)));
|
|
395
|
-
const spotAttenuation = select(isSpot, smoothstep(spot.w, color.w, dot(normalize(position.xyz.sub(worldPosition)), spot.xyz)), float(1.0)).toVar();
|
|
396
|
-
If(enabled.and(spotAttenuation.greaterThan(0.0)), () => {
|
|
397
|
-
const toLight = frameWorldToLocal.mul(vec4(position.xyz, 1.0)).xyz.sub(localPosition).toVar();
|
|
398
|
-
const localDirection = select(isDirectional, worldToLocalDirection.mul(position.xyz), toLight);
|
|
399
|
-
const maxDistance = select(isDirectional, float(1e6), length(toLight));
|
|
400
|
-
const lightDirection = select(isDirectional, position.xyz, normalize(position.xyz.sub(worldPosition)));
|
|
401
|
-
const shadow = march(localDirection, maxDistance);
|
|
402
|
-
// NOTE Two-sided: diffusion of the slab between the light side and the far side (frameTwoSidedDiffusion)
|
|
403
|
-
If(this.frameTwoSided.greaterThan(0.5), () => {
|
|
404
|
-
const back = march(localDirection.negate(), float(1e6));
|
|
405
|
-
shadow.y.assign(frameTwoSidedDiffusion(shadow.x, shadow.z, shadow.w, back.z));
|
|
406
|
-
});
|
|
407
|
-
const light = spectral
|
|
408
|
-
? frameSpectralShadowedLight(volumeUniforms.framePhase, volumeUniforms.framePhaseSpectrum, this.frameScatteringOctaves, rayDirection, lightDirection, shadow, albedo)
|
|
409
|
-
: frameShadowedLight(volumeUniforms.framePhase, volumeUniforms.framePhaseSpectrum, this.frameScatteringOctaves, rayDirection, lightDirection, shadow.xy.toVar());
|
|
410
|
-
irradiance.addAssign(color.rgb.mul(light).mul(spotAttenuation));
|
|
411
|
-
});
|
|
412
|
-
});
|
|
413
|
-
const radiance = max(frameScatterColor, albedo.mul(irradiance).mul(1.0 / Math.PI)).add(volume.sampleEmission(localPosition, lod));
|
|
414
|
-
// NOTE Premultiplied slice color and alpha. Linear filtering of these values gives transparent edges.
|
|
415
|
-
if (spectralOutputs) {
|
|
416
|
-
spectralOutputs.color.assign(vec4(radiance.mul(alpha), alpha.y));
|
|
417
|
-
spectralOutputs.alpha.assign(vec4(alpha.x, alpha.z, 0.0, alpha.y));
|
|
418
|
-
return vec4(0.0);
|
|
419
|
-
}
|
|
420
|
-
return vec4(radiance.mul(alpha), alpha);
|
|
421
|
-
})();
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
//# sourceMappingURL=inject-material.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inject-material.js","sourceRoot":"","sources":["../../../src/three/frame/inject-material.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,2FAA2F;AAC3F,iGAAiG;AACjG,oGAAoG;AACpG,0GAA0G;AAC1G,uGAAuG;AACvG,4FAA4F;AAC5F,iGAAiG;AACjG,oGAAoG;AACpG,4GAA4G;AAC5G,kGAAkG;AAClG,mGAAmG;AACnG,sGAAsG;AACtG,4GAA4G;AAC5G,wGAAwG;AACxG,8EAA8E;AAC9E,sEAAsE;AAEtE;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,GAMb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,sGAAsG;AACtG,uCAAuC;AACvC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,iB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AAC,iBAAiB,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC;YAElI,sGAAsG;YACtG,IAAI,eAAe,EAAE,CAAC;gBACpB,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjE,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAEnE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC;YAED,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;QAC1C,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/FrameInjectMaterial.js L59–101 (constructor, blending),\n// L142–284 (froxel pre-integration, shadow march), L395–398 (ambient), L453–532 (scene lights,\n// radiance, premultiplied output); K3.4: L73–76 (octave and two-sided uniforms), L270–277 (octave\n// march depth and transmittance), L488–512 (the two-sided back march, frameShadowedLight with octaves);\n// K3.5: L80–81 and L103–130 (spectral flag, setSpectral, rebuildNodes and the two spectral outputs),\n// L200–229 (the spectral pre-integration), L286–348 (the spectral shadow march), L350–383\n// (totalTransmittance, the diffusion pair, isotropicTransmittance), L385–451 (the light-probe,\n// environment and hemisphere terms), L499–532 (frameSpectralShadowedLight, the spectral outputs).\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; with a sparse source the shadow march skips empty space\n// through the source's HDDA query (K3.2, same lattice, same values; also for the spectral march); the\n// hemisphere and environment-light loops are compiled in only when the scene has such lights, and isotropic\n// light marches each direction once (his code marches the front direction again when diffusion is off):\n// the same values, a smaller shader (the HDDA march is large on SwiftShader).\n// Divergences: DIVERGES.md (K3.1, K3.2, K3.4 and K3.5 rows), V23–V25.\n\n/**\n * `'volume'` lighting (R1 §2): lights one volume in each froxel with a shadow march through that\n * volume's own source. Other volumes do not cast shadows on it. The renderer draws it once per\n * volume, one instance per slice of the volume's froxel rectangle. Lights: ambient and the light\n * probe (along the outward normal), the scene environment (environment lights with one march each,\n * or the PMREM irradiance along the outward direction), hemisphere lights (sky and ground marches),\n * and the directional, point and spot lights, each gated by the volume's `lights` bitmask. Diffusion\n * multiple scattering gives isotropic light the two-sided total of a march pair (white furnace).\n * Spectral (K3.5): per-channel extinction (the volume's spectrum), albedo and multiple scattering,\n * two atlas targets.\n */\n\nimport * as THREE from \"three\";\nimport * as TSL from \"three/tsl\";\nimport type { VDBTslNode } from \"../grid-node.js\";\nimport type { VDBThreeVolumeSource, VDBVolumeNodes, VDBVolumeNodesOptions, VDBVolumeUniforms } from \"../volume-source.js\";\nimport { vdbVolumeNodes } from \"../volume-source.js\";\nimport {\n createFrameVolumeUniforms,\n frameDistanceFade,\n frameFragCoord,\n frameGetFroxel,\n frameIsotropicDiffusion,\n frameMeanComponent,\n frameNoise,\n frameShadowAbsorption,\n frameShadowMarchDepth,\n frameShadowStep,\n frameShadowTotal,\n frameShadowTransmittance,\n frameShadowedLight,\n frameSpectralShadowDepths,\n frameSpectralShadowTotal,\n frameSpectralShadowTransmittance,\n frameSpectralShadowUnit,\n frameSpectralShadowedLight,\n frameTileVertex,\n frameTwoSidedDiffusion,\n getBoxSteps,\n getFroxelLod,\n getSampledLod,\n maxComponent,\n minComponent,\n type FrameSpectralDepths,\n type FrameVolumeUniforms,\n type FroxelUniforms,\n type LightUniforms,\n type TileUniforms,\n} from \"./chunks.js\";\nimport { VDBFrameEnvironmentMaterial } from \"./environment-material.js\";\nimport { vdbFrameLights } from \"./lights.js\";\n\n// NOTE TSL's r187 typings narrow node types; the ported shader code is written against untyped nodes,\n// as volume-source.ts is (VDBTslNode).\nconst { Break, Continue, Discard, Fn, If, Loop, ceil, dot, exp, float, getShIrradianceAt, int, length, mat3, max, min, mix, normalize, outputStruct, property, select, smoothstep, uniform, vec2, vec3, vec4 } = TSL as unknown as Record<string, VDBTslNode>;\n\nexport interface VDBFrameInjectMaterialOptions {\n froxelUniforms: FroxelUniforms;\n froxelTileUniforms: TileUniforms;\n lightUniforms: LightUniforms;\n /** The volume source (dense, or sparse since K3.2: the same node shape). */\n source: VDBThreeVolumeSource;\n /** The source's live uniforms (`vdbVolumeUniforms`). */\n sourceUniforms: VDBVolumeUniforms;\n /** Sample the source's mip levels (his shaders built with mipmaps). */\n mipmaps: boolean;\n /** Emission colour hook of `vdbVolumeNodes` (DIVERGES V24). */\n emissionColor?: VDBVolumeNodesOptions[\"emissionColor\"];\n /** Skip empty space in the shadow march when the source can (`skipEmpty`; sparse). Default false (K3.2 A/B). */\n hdda?: boolean;\n /** Renderer settings.spectral (K3.5). Default false. */\n spectral?: boolean;\n /** Compile the hemisphere-light loop (the scene has hemisphere lights). Default false. */\n hemisphereLights?: boolean;\n /** Compile the environment-light loop (the renderer has 'directional' / SH environment lights). Default false. */\n environmentLights?: boolean;\n}\n\n/** A shadow march result: (direct, total, reduced depth, effective depth), floats or (spectral) vec3. */\ninterface InjectShadow {\n x: VDBTslNode;\n y: VDBTslNode;\n z: VDBTslNode;\n w: VDBTslNode;\n}\n\n// NOTE Lights one volume in each froxel, with a shadow march in this volume. Other volumes do not cast shadows.\n// NOTE The renderer draws it one time for each volume, with the uniforms of that volume.\nexport class VDBFrameInjectMaterial extends VDBFrameEnvironmentMaterial {\n readonly froxelUniforms: FroxelUniforms;\n readonly lightUniforms: LightUniforms;\n readonly volumeUniforms: FrameVolumeUniforms;\n readonly sourceUniforms: VDBVolumeUniforms;\n readonly source: VDBThreeVolumeSource;\n readonly frameLights = uniform(0, \"int\");\n readonly frameShadowSteps = uniform(32, \"int\");\n // NOTE Multiple scattering of this volume (phase.ts). 0.0 is single scattering.\n readonly frameMultipleScattering = uniform(0.0);\n // NOTE Scattering octaves of the renderer settings (phase.ts). Count 0 is off.\n readonly frameScatteringOctaves = uniform(new THREE.Vector4());\n // NOTE multipleScattering 'two-sided' (phase.ts): scene light shadows also march away from the light\n readonly frameTwoSided = uniform(0.0);\n readonly frameCameraMatrixWorld = uniform(new THREE.Matrix4());\n // NOTE The froxel rectangle and the slices of the volume of this draw. One instance for each slice.\n readonly frameRect = uniform(new THREE.Vector4());\n readonly frameSliceStart = uniform(0.0);\n mipmaps: boolean;\n hdda: boolean;\n // NOTE Renderer settings.spectral: extinction and multiple scattering of each channel, two atlas targets\n spectral: boolean;\n // NOTE Light loops compiled in (setLightTerms). Without them the loop counts are 0, so the result is the same.\n hemisphereLights: boolean;\n environmentLights: boolean;\n readonly emissionColor: VDBVolumeNodesOptions[\"emissionColor\"];\n\n constructor(o: VDBFrameInjectMaterialOptions) {\n super();\n\n this.name = \"VDBFrameInjectMaterial\";\n this.froxelUniforms = o.froxelUniforms;\n this.lightUniforms = o.lightUniforms;\n this.volumeUniforms = createFrameVolumeUniforms();\n this.source = o.source;\n this.sourceUniforms = o.sourceUniforms;\n this.mipmaps = o.mipmaps;\n this.hdda = o.hdda ?? false;\n this.spectral = o.spectral ?? false;\n this.hemisphereLights = o.hemisphereLights ?? false;\n this.environmentLights = o.environmentLights ?? false;\n this.emissionColor = o.emissionColor;\n\n this.vertexNode = frameTileVertex(o.froxelTileUniforms, this.frameRect, this.frameSliceStart);\n this.rebuildNodes();\n\n this.side = THREE.DoubleSide;\n this.forceSinglePass = true;\n this.transparent = true;\n this.depthTest = false;\n this.depthWrite = false;\n\n // NOTE Premultiplied \"over\" blend. Overlapping volumes in one froxel multiply their transmittance.\n this.blending = THREE.CustomBlending;\n this.blendEquation = THREE.AddEquation;\n this.blendSrc = THREE.OneFactor;\n this.blendDst = THREE.OneMinusSrcAlphaFactor;\n this.blendSrcAlpha = THREE.OneFactor;\n this.blendDstAlpha = THREE.OneMinusSrcAlphaFactor;\n }\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.environmentNodes = [];\n this.rebuildNodes();\n this.needsUpdate = true;\n }\n }\n\n // NOTE HDDA skipping is compiled in only when on (K3.2 A/B)\n setHdda(hdda: boolean): void {\n if (hdda !== this.hdda) {\n this.hdda = hdda;\n this.environmentNodes = [];\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.environmentNodes = [];\n this.rebuildNodes();\n this.needsUpdate = true;\n }\n }\n\n // NOTE Compile the hemisphere and environment-light loops only for scenes that have those lights\n setLightTerms(hemisphereLights: boolean, environmentLights: boolean): void {\n if (hemisphereLights !== this.hemisphereLights || environmentLights !== this.environmentLights) {\n this.hemisphereLights = hemisphereLights;\n this.environmentLights = environmentLights;\n this.environmentNodes = [];\n this.rebuildNodes();\n this.needsUpdate = true;\n }\n }\n\n // NOTE Spectral: atlas target 0 is (color, green alpha), target 1 is (red alpha, blue alpha, 0, green alpha).\n // NOTE Both targets blend with the green alpha (w of each output).\n override rebuildNodes(): void {\n if (!this.spectral) {\n this.colorNode = null;\n this.outputNode = null;\n this.fragmentNode = this.createFragmentNode();\n\n return;\n }\n\n const injectColor = property(\"vec4\");\n const injectAlpha = property(\"vec4\");\n\n this.fragmentNode = null;\n this.colorNode = this.createFragmentNode({ color: injectColor, alpha: injectAlpha });\n this.outputNode = outputStruct(injectColor, injectAlpha);\n }\n\n // NOTE spectralOutputs: { color, alpha } property nodes of the spectral targets. null: one target.\n createFragmentNode(spectralOutputs: { color: VDBTslNode; alpha: VDBTslNode } | null = null): VDBTslNode {\n const spectral = spectralOutputs !== null;\n const { froxelUniforms, lightUniforms, volumeUniforms, sourceUniforms, source } = this;\n const { froxelGrid, froxelSubSteps, froxelAtlasSize, frameJitter } = froxelUniforms;\n const { frameAmbientColor, frameLightProbe, frameHemiCount, frameHemiSkyColors, frameHemiGroundColors, frameHemiDirections, frameLightCount, frameLightPositions, frameLightColors, frameLightSpots, frameEnvironmentCount, frameEnvironmentDirections, frameEnvironmentColors } = lightUniforms;\n const { frameViewToLocal, frameLocalToView, frameWorldToLocal, frameOpacity, frameAbsorbance, frameScatterColor, frameExtinctionSpectrum } = volumeUniforms;\n const frameWorldScale = sourceUniforms.worldScale;\n const volume: VDBVolumeNodes = vdbVolumeNodes(source, sourceUniforms, { useMipmaps: this.mipmaps, ...(this.emissionColor ? { emissionColor: this.emissionColor } : {}) });\n const skipEmpty = this.hdda && volume.skipEmpty ? volume.skipEmpty.bind(volume) : null;\n\n const useLights = (flag: number) => this.frameLights.bitAnd(int(flag)).notEqual(0);\n\n return Fn(() => {\n const fragCoord = frameFragCoord(froxelAtlasSize).toVar();\n const froxel = frameGetFroxel(froxelUniforms, fragCoord);\n\n If(froxel.slice.greaterThanEqual(froxelGrid.z), () => {\n Discard();\n });\n\n const viewNear = froxel.viewNear.toVar();\n const viewFar = froxel.viewFar.toVar();\n const localNear = frameViewToLocal.mul(vec4(viewNear, 1.0)).xyz.toVar();\n const localFar = frameViewToLocal.mul(vec4(viewFar, 1.0)).xyz.toVar();\n const boxSegment = volume.boxSegment(localNear, localFar).toVar();\n\n If(boxSegment.x.greaterThanEqual(boxSegment.y), () => {\n Discard();\n });\n\n const segment = boxSegment.y.sub(boxSegment.x).toVar();\n const widthLod = getFroxelLod(froxelUniforms, froxel, volume, float(0.0), frameWorldScale);\n const sampledLod = getSampledLod(sourceUniforms, source.channels.mask, widthLod, this.mipmaps);\n const steps = getBoxSteps(volume, localNear, localFar, segment, sampledLod, froxelSubSteps);\n const subStepCount = float(steps);\n const subStepLength = length(viewFar.sub(viewNear)).mul(segment).div(subStepCount).toVar();\n const lod = max(widthLod, volume.getLod(subStepLength.div(frameWorldScale))).toVar();\n\n // NOTE Pre-integrate the slice along the view ray. Light the visibility-weighted mean position, not the froxel center.\n // NOTE Spectral: transmittance of each channel. The visible position uses the mean of the channels.\n const transmittance = (spectral ? vec3(1.0) : float(1.0)).toVar();\n const visibleWeight = float(0.0).toVar();\n const visibleTSum = float(0.0).toVar();\n const jitter = frameNoise(frameJitter, fragCoord).toVar();\n\n Loop({ start: int(0), end: steps, type: \"int\", condition: \"<\" }, ({ i }: { i: VDBTslNode }) => {\n const t = boxSegment.x.add(segment.mul(float(i).add(jitter).div(subStepCount))).toVar();\n const opticalDepth = volume\n .sampleExtinction(mix(localNear, localFar, t), lod)\n .mul(frameOpacity)\n .mul(frameDistanceFade(froxelUniforms, mix(viewNear, viewFar, t)))\n .mul(subStepLength);\n const stepTransmittance = exp((spectral ? frameExtinctionSpectrum.mul(opticalDepth) : opticalDepth).negate()).toVar();\n const stepWeight = transmittance.mul(float(1.0).sub(stepTransmittance));\n const weight = (spectral ? frameMeanComponent(stepWeight) : stepWeight).toVar();\n\n visibleWeight.addAssign(weight);\n visibleTSum.addAssign(weight.mul(t));\n transmittance.mulAssign(stepTransmittance);\n });\n\n const alpha = (spectral ? vec3(1.0) : float(1.0)).sub(transmittance).toVar();\n\n If(visibleWeight.lessThanEqual(0.0).or((spectral ? maxComponent(alpha) : alpha).lessThanEqual(1e-5)), () => {\n Discard();\n });\n\n const localPosition = mix(localNear, localFar, visibleTSum.div(visibleWeight)).toVar();\n const viewPosition = frameLocalToView.mul(vec4(localPosition, 1.0)).xyz;\n const worldPosition = this.frameCameraMatrixWorld.mul(vec4(viewPosition, 1.0)).xyz.toVar();\n const worldToLocalDirection = mat3(frameWorldToLocal);\n const rayDirection = normalize(mat3(this.frameCameraMatrixWorld).mul(viewFar.sub(viewNear))).toVar();\n const shadowNoise = frameNoise(frameJitter, fragCoord.add(vec2(17.0, 31.0))).toVar();\n const albedo = volume.sampleAlbedo(localPosition, lod).toVar();\n\n // NOTE The shadow sample loop of both marches. sample(extinction) adds one sample (extinction × world step × absorbance);\n // stop() is the march depth test after it. The HDDA variant (K3.2) jumps over the runs of samples the source proves empty.\n const marchSamples = (direction: VDBTslNode, marchDistance: VDBTslNode, localStep: VDBTslNode, stepLod: VDBTslNode, stepScale: VDBTslNode, sample: (extinction: VDBTslNode) => void, stop: () => VDBTslNode) => {\n if (skipEmpty) {\n // K3.2: the same sample lattice t_k = localStep (k + noise), but runs of samples the source proves\n // empty (exactly 0 extinction, so 0 depth) are jumped over. Positions are computed, not accumulated.\n // The source is asked only at the start and after a zero sample, so dense runs pay nothing for it.\n const k = int(0).toVar();\n const cellEnd = float(-1.0).toVar();\n const lastZero = float(1.0).toVar();\n const tEnd = marchDistance.add(localStep).toVar();\n\n Loop(k.lessThan(this.frameShadowSteps), () => {\n const t = localStep.mul(float(k).add(shadowNoise)).toVar();\n\n If(t.greaterThanEqual(cellEnd).and(lastZero.greaterThan(0.5)), () => {\n const span = skipEmpty(localPosition, direction, t, tEnd, stepLod).toVar();\n cellEnd.assign(span.y);\n\n If(span.x.greaterThan(t), () => {\n k.assign(max(k.add(1), int(ceil(span.x.div(localStep).sub(shadowNoise)))));\n Continue();\n });\n });\n\n const extinction = volume.sampleExtinction(localPosition.add(direction.mul(t)), stepLod).mul(stepScale).toVar();\n lastZero.assign(select(extinction.lessThanEqual(0.0), float(1.0), float(0.0)));\n\n sample(extinction);\n\n If(stop(), () => {\n Break();\n });\n\n k.addAssign(1);\n });\n } else {\n const probe = localPosition.add(direction.mul(localStep).mul(shadowNoise)).toVar();\n\n Loop(this.frameShadowSteps, () => {\n const extinction = volume.sampleExtinction(probe, stepLod).mul(stepScale).toVar();\n\n sample(extinction);\n\n If(stop(), () => {\n Break();\n });\n\n probe.addAssign(direction.mul(localStep));\n });\n }\n };\n\n // NOTE Shadow march inside this volume only. Call in the Fn body.\n // NOTE Returns (direct, total, reduced depth, effective depth). The absorption uses the albedo at the lit position.\n const volumeTransmittance = (localDirection: VDBTslNode, maxLocalDistance: VDBTslNode): InjectShadow => {\n const result = vec4(1.0, 1.0, 0.0, 0.0).toVar();\n\n If(frameAbsorbance.greaterThan(0.0).and(this.frameShadowSteps.greaterThan(0)), () => {\n const direction = normalize(localDirection).toVar();\n const marchDistance = min(volume.boxExit(localPosition, direction), maxLocalDistance).toVar();\n\n If(marchDistance.greaterThan(0.0), () => {\n const localStep = marchDistance.div(float(this.frameShadowSteps)).toVar();\n const stepLod = max(lod, volume.getLod(localStep)).toVar();\n const worldStep = localStep.mul(length(mat3(frameLocalToView).mul(direction)));\n const stepScale = worldStep.mul(frameAbsorbance).toVar();\n const depths = vec3(0.0).toVar();\n\n marchSamples(\n direction,\n marchDistance,\n localStep,\n stepLod,\n stepScale,\n (extinction) => {\n depths.addAssign(frameShadowStep(extinction, frameShadowAbsorption(extinction, albedo), this.frameMultipleScattering));\n },\n () => frameShadowMarchDepth(depths, this.frameMultipleScattering, this.frameScatteringOctaves).greaterThan(8.0),\n );\n\n const shadow = frameShadowTransmittance(depths, this.frameMultipleScattering, this.frameScatteringOctaves);\n\n result.assign(vec4(shadow.x, shadow.y, depths.z, depths.y));\n });\n });\n\n return result;\n };\n\n // NOTE Spectral shadow march. One volume has one spectrum, so the march sums one optical depth.\n // Then the depths of each channel are linear in it (frameSpectralShadowDepths).\n // Returns { x: direct, y: total, z: reduced depth, w: effective depth }, vec3 values.\n const shadowUnit: FrameSpectralDepths | null = spectral ? frameSpectralShadowUnit(frameExtinctionSpectrum, albedo, this.frameMultipleScattering) : null;\n\n const spectralVolumeTransmittance = (localDirection: VDBTslNode, maxLocalDistance: VDBTslNode): InjectShadow => {\n const direct = vec3(1.0).toVar();\n const total = vec3(1.0).toVar();\n const reduced = vec3(0.0).toVar();\n const effective = vec3(0.0).toVar();\n\n If(frameAbsorbance.greaterThan(0.0).and(this.frameShadowSteps.greaterThan(0)), () => {\n const direction = normalize(localDirection).toVar();\n const marchDistance = min(volume.boxExit(localPosition, direction), maxLocalDistance).toVar();\n\n If(marchDistance.greaterThan(0.0), () => {\n const localStep = marchDistance.div(float(this.frameShadowSteps)).toVar();\n const stepLod = max(lod, volume.getLod(localStep)).toVar();\n const worldStep = localStep.mul(length(mat3(frameLocalToView).mul(direction)));\n const stepScale = worldStep.mul(frameAbsorbance).toVar();\n const opticalDepth = float(0.0).toVar();\n\n marchSamples(\n direction,\n marchDistance,\n localStep,\n stepLod,\n stepScale,\n (extinction) => {\n opticalDepth.addAssign(extinction);\n },\n // NOTE Stop when all channels are dark\n () => minComponent(frameShadowMarchDepth(frameSpectralShadowDepths(shadowUnit!, opticalDepth), this.frameMultipleScattering, this.frameScatteringOctaves)).greaterThan(8.0),\n );\n\n const depths = frameSpectralShadowDepths(shadowUnit!, opticalDepth);\n const shadow = frameSpectralShadowTransmittance(depths, this.frameMultipleScattering, this.frameScatteringOctaves);\n\n direct.assign(shadow.x);\n total.assign(shadow.y);\n reduced.assign(depths.z);\n effective.assign(depths.y);\n });\n });\n\n return { x: direct, y: total, z: reduced, w: effective };\n };\n\n const march = spectral ? spectralVolumeTransmittance : volumeTransmittance;\n\n // NOTE Isotropic light (no phase): total transmittance of a march's total (y) value\n const shadowTotal = (total: VDBTslNode) => (spectral ? frameSpectralShadowTotal(total, this.frameScatteringOctaves, albedo) : frameShadowTotal(total, this.frameScatteringOctaves));\n\n // NOTE Diffusion: two-sided totals of isotropic light (frameIsotropicDiffusion) of a direction and the opposite one.\n // Spectral: vec3 values, one for each channel. Call in the Fn body.\n const diffusion = this.frameMultipleScattering.greaterThan(0.0);\n const isotropicValue = () => (spectral ? vec3(1.0) : float(1.0)).toVar();\n\n // NOTE Total transmittance of isotropic light from one direction ({ x }) and the opposite one ({ y }), each marched once.\n // Diffusion: the two-sided totals of the pair. Single scattering or octaves: the total of each march. Call in the Fn body.\n const isotropicPair = (localDirection: VDBTslNode, withOpposite: boolean) => {\n const front = march(localDirection, float(1e6));\n const x = isotropicValue();\n const y = isotropicValue();\n\n if (withOpposite) {\n const back = march(localDirection.negate(), float(1e6));\n\n If(diffusion, () => {\n x.assign(frameIsotropicDiffusion(front.z, back.z, front.w));\n y.assign(frameIsotropicDiffusion(back.z, front.z, back.w));\n }).Else(() => {\n x.assign(shadowTotal(front.y));\n y.assign(shadowTotal(back.y));\n });\n } else {\n If(diffusion, () => {\n const back = march(localDirection.negate(), float(1e6));\n\n x.assign(frameIsotropicDiffusion(front.z, back.z, front.w));\n }).Else(() => {\n x.assign(shadowTotal(front.y));\n });\n }\n\n return { x, y };\n };\n\n const outwardNormal = select(\n length(localPosition).greaterThan(1e-4),\n normalize(mat3(this.frameCameraMatrixWorld).mul(mat3(frameLocalToView).mul(localPosition))),\n vec3(0.0, 1.0, 0.0),\n ).toVar();\n\n const irradiance = vec3(0.0).toVar();\n\n If(useLights(vdbFrameLights.useAmbientLights), () => {\n irradiance.addAssign(frameAmbientColor);\n irradiance.addAssign(getShIrradianceAt(outwardNormal, frameLightProbe));\n });\n\n // NOTE Outward direction of the scene environment (no environment lights). Diffusion: the outward and the inward\n // irradiance, each with its two-sided total. Uniform light then gives E.\n const outwardEnvironment = () => {\n if (this.environment) {\n const outwardDirection = worldToLocalDirection.mul(outwardNormal).toVar();\n const front = march(outwardDirection, float(1e6));\n\n If(diffusion, () => {\n const back = march(outwardDirection.negate(), float(1e6));\n\n irradiance.addAssign(this.environmentIrradiance(outwardNormal).mul(frameIsotropicDiffusion(front.z, back.z, front.w).mul(0.5)));\n irradiance.addAssign(this.environmentIrradiance(outwardNormal.negate()).mul(frameIsotropicDiffusion(back.z, front.z, back.w).mul(0.5)));\n }).Else(() => {\n irradiance.addAssign(this.environmentIrradiance(outwardNormal).mul(shadowTotal(front.y)));\n });\n }\n };\n\n // NOTE Environment lights replace the outward direction: one shadow march for each light, no phase\n If(useLights(vdbFrameLights.useEnvironment), () => {\n if (this.environmentLights) {\n If(frameEnvironmentCount.greaterThan(0), () => {\n const environment = vec3(0.0).toVar();\n\n Loop(frameEnvironmentCount, ({ i }: { i: VDBTslNode }) => {\n const direction = worldToLocalDirection.mul(frameEnvironmentDirections.element(i)).toVar();\n\n environment.addAssign(frameEnvironmentColors.element(i).mul(isotropicPair(direction, false).x));\n });\n\n irradiance.addAssign(max(environment, vec3(0.0)));\n }).Else(outwardEnvironment);\n } else {\n outwardEnvironment();\n }\n });\n\n if (this.hemisphereLights) {\n If(useLights(vdbFrameLights.useHemisphereLights), () => {\n Loop(frameHemiCount, ({ i }: { i: VDBTslNode }) => {\n const upDirection = worldToLocalDirection.mul(frameHemiDirections.element(i)).toVar();\n // NOTE Diffusion: sky and ground are an opposite pair, two-sided totals\n const pair = isotropicPair(upDirection, true);\n\n irradiance.addAssign(frameHemiSkyColors.element(i).mul(0.5).mul(pair.x));\n irradiance.addAssign(frameHemiGroundColors.element(i).mul(0.5).mul(pair.y));\n });\n });\n }\n\n // NOTE Point and spot lights have no distance falloff\n Loop(frameLightCount, ({ i }: { i: VDBTslNode }) => {\n const position = frameLightPositions.element(i).toVar();\n const color = frameLightColors.element(i).toVar();\n const spot = frameLightSpots.element(i).toVar();\n const isDirectional = position.w.lessThan(1.5);\n const isSpot = position.w.greaterThan(2.5);\n const enabled = select(\n isDirectional,\n useLights(vdbFrameLights.useDirectionalLights),\n select(isSpot, useLights(vdbFrameLights.useSpotLights), useLights(vdbFrameLights.usePointLights)),\n );\n const spotAttenuation = select(\n isSpot,\n smoothstep(spot.w, color.w, dot(normalize(position.xyz.sub(worldPosition)), spot.xyz)),\n float(1.0),\n ).toVar();\n\n If(enabled.and(spotAttenuation.greaterThan(0.0)), () => {\n const toLight = frameWorldToLocal.mul(vec4(position.xyz, 1.0)).xyz.sub(localPosition).toVar();\n const localDirection = select(isDirectional, worldToLocalDirection.mul(position.xyz), toLight);\n const maxDistance = select(isDirectional, float(1e6), length(toLight));\n const lightDirection = select(isDirectional, position.xyz, normalize(position.xyz.sub(worldPosition)));\n const shadow = march(localDirection, maxDistance);\n\n // NOTE Two-sided: diffusion of the slab between the light side and the far side (frameTwoSidedDiffusion)\n If(this.frameTwoSided.greaterThan(0.5), () => {\n const back = march(localDirection.negate(), float(1e6));\n\n shadow.y.assign(frameTwoSidedDiffusion(shadow.x, shadow.z, shadow.w, back.z));\n });\n\n const light = spectral\n ? frameSpectralShadowedLight(volumeUniforms.framePhase, volumeUniforms.framePhaseSpectrum, this.frameScatteringOctaves, rayDirection, lightDirection, shadow, albedo)\n : frameShadowedLight(volumeUniforms.framePhase, volumeUniforms.framePhaseSpectrum, this.frameScatteringOctaves, rayDirection, lightDirection, (shadow as VDBTslNode).xy.toVar());\n\n irradiance.addAssign(color.rgb.mul(light).mul(spotAttenuation));\n });\n });\n\n const radiance = max(frameScatterColor, albedo.mul(irradiance).mul(1.0 / Math.PI)).add(volume.sampleEmission(localPosition, lod));\n\n // NOTE Premultiplied slice color and alpha. Linear filtering of these values gives transparent edges.\n if (spectralOutputs) {\n spectralOutputs.color.assign(vec4(radiance.mul(alpha), alpha.y));\n spectralOutputs.alpha.assign(vec4(alpha.x, alpha.z, 0.0, alpha.y));\n\n return vec4(0.0);\n }\n\n return vec4(radiance.mul(alpha), alpha);\n })();\n }\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { NodeMaterial } from "three/webgpu";
|
|
2
|
-
import type { VDBTslNode } from "../grid-node.js";
|
|
3
|
-
import { type FroxelUniforms } from "./chunks.js";
|
|
4
|
-
export declare class VDBFrameIntegrateMaterial extends NodeMaterial {
|
|
5
|
-
readonly froxelAtlas: VDBTslNode;
|
|
6
|
-
readonly froxelAlphaAtlas: VDBTslNode;
|
|
7
|
-
spectral: boolean;
|
|
8
|
-
readonly frameCameraNear: any;
|
|
9
|
-
readonly frameCameraFar: any;
|
|
10
|
-
readonly frameCameraOrthographic: any;
|
|
11
|
-
readonly frameScreenRect: any;
|
|
12
|
-
readonly frameSliceRange: any;
|
|
13
|
-
readonly froxelUniforms: FroxelUniforms;
|
|
14
|
-
srgbBlending: boolean | null;
|
|
15
|
-
srgbClamp: boolean | null;
|
|
16
|
-
constructor({ froxelUniforms }: {
|
|
17
|
-
froxelUniforms: FroxelUniforms;
|
|
18
|
-
});
|
|
19
|
-
setSrgbBlending(srgbBlending: boolean, srgbClamp: boolean): void;
|
|
20
|
-
setSpectral(spectral: boolean): void;
|
|
21
|
-
updateNodes(): void;
|
|
22
|
-
createSrgbColor(): (color: VDBTslNode) => VDBTslNode;
|
|
23
|
-
createSceneDepth(): VDBTslNode;
|
|
24
|
-
createSpectralFragmentNode(): VDBTslNode;
|
|
25
|
-
createFragmentNode(): VDBTslNode;
|
|
26
|
-
}
|