@luma.gl/engine 10.0.0-alpha.9 → 10.0.0-beta.1
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/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +185 -0
- package/dist/animation/node-animation-binding.cjs +10 -0
- package/dist/animation/node-animation-binding.d.ts +1 -1
- package/dist/animation/node-animation-binding.d.ts.map +1 -1
- package/dist/animation/node-animation-binding.js +10 -0
- package/dist/animation/node-animation-binding.js.map +1 -1
- package/dist/arrow/index.cjs.map +2 -2
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.cjs +12 -13
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.d.ts.map +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +22 -17
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.cjs +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js.map +1 -1
- package/dist/compute/computation.cjs +1 -1
- package/dist/compute/computation.js +1 -1
- package/dist/compute/computation.js.map +1 -1
- package/dist/compute/swap.d.ts +2 -2
- package/dist/compute/swap.d.ts.map +1 -1
- package/dist/compute/swap.js.map +1 -1
- package/dist/dist.dev.js +887 -381
- package/dist/dist.min.js +74 -67
- package/dist/dynamic-texture/video-texture.cjs +1 -1
- package/dist/dynamic-texture/video-texture.d.ts +3 -3
- package/dist/dynamic-texture/video-texture.d.ts.map +1 -1
- package/dist/dynamic-texture/video-texture.js +1 -1
- package/dist/dynamic-texture/video-texture.js.map +1 -1
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js +2 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js.map +1 -1
- package/dist/gltf/gltf/animations/animations.d.ts +1 -1
- package/dist/gltf/gltf/animations/animations.d.ts.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.cjs +3 -0
- package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.js +4 -0
- package/dist/gltf/gltf/create-gltf-model.js.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +80 -12
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +8 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js +82 -14
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
- package/dist/gltf/gltf/gltf-billboard.cjs +6 -1
- package/dist/gltf/gltf/gltf-billboard.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-billboard.js +6 -1
- package/dist/gltf/gltf/gltf-billboard.js.map +1 -1
- package/dist/gltf/gltf/gltf-extension-support.cjs +2 -2
- package/dist/gltf/gltf/gltf-extension-support.js +2 -2
- package/dist/gltf/gltf/gltf-extension-support.js.map +1 -1
- package/dist/gltf/index.cjs +2 -0
- package/dist/gltf/index.cjs.map +3 -3
- package/dist/gltf/index.d.ts +1 -1
- package/dist/gltf/index.d.ts.map +1 -1
- package/dist/gltf/index.js +1 -1
- package/dist/gltf/index.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-animations.cjs +8 -5
- package/dist/gltf/parsers/parse-gltf-animations.js +20 -5
- package/dist/gltf/parsers/parse-gltf-animations.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.cjs +36 -72
- package/dist/gltf/parsers/parse-gltf-lights.d.ts +6 -2
- package/dist/gltf/parsers/parse-gltf-lights.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.js +34 -91
- package/dist/gltf/parsers/parse-gltf-lights.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-metadata.cjs +60 -0
- package/dist/gltf/parsers/parse-gltf-metadata.d.ts +5 -0
- package/dist/gltf/parsers/parse-gltf-metadata.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-gltf-metadata.js +39 -0
- package/dist/gltf/parsers/parse-gltf-metadata.js.map +1 -0
- package/dist/gltf/parsers/parse-gltf.cjs +4 -1
- package/dist/gltf/parsers/parse-gltf.d.ts +10 -2
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf.js +3 -0
- package/dist/gltf/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.cjs +13 -3
- package/dist/gltf/parsers/parse-pbr-material.d.ts +7 -2
- package/dist/gltf/parsers/parse-pbr-material.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.js +17 -5
- package/dist/gltf/parsers/parse-pbr-material.js.map +1 -1
- package/dist/gltf/pbr/pbr-environment.cjs +21 -3
- package/dist/gltf/pbr/pbr-environment.d.ts +3 -0
- package/dist/gltf/pbr/pbr-environment.d.ts.map +1 -1
- package/dist/gltf/pbr/pbr-environment.js +19 -1
- package/dist/gltf/pbr/pbr-environment.js.map +1 -1
- package/dist/gltf/pbr/pbr-material.d.ts +3 -3
- package/dist/gltf/pbr/pbr-material.d.ts.map +1 -1
- package/dist/gltf/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/gltf/types/gltf-json-schema.js +1 -0
- package/dist/gltf/types/gltf-json-schema.js.map +1 -1
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts.map +1 -1
- package/dist/gltf/types/gltf-postprocessed-schema.js +1 -0
- package/dist/gltf/types/gltf-postprocessed-schema.js.map +1 -1
- package/dist/graph/models/index.cjs.map +1 -1
- package/dist/graph/models/path/path-attribute-model.cjs +4 -1
- package/dist/graph/models/path/path-attribute-model.d.ts +3 -1
- package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -1
- package/dist/graph/models/path/path-attribute-model.js +6 -1
- package/dist/graph/models/path/path-attribute-model.js.map +1 -1
- package/dist/graph/models/path/path-storage-model.cjs +4 -1
- package/dist/graph/models/path/path-storage-model.d.ts +3 -1
- package/dist/graph/models/path/path-storage-model.d.ts.map +1 -1
- package/dist/graph/models/path/path-storage-model.js +6 -1
- package/dist/graph/models/path/path-storage-model.js.map +1 -1
- package/dist/graph/physics/index.cjs.map +2 -2
- package/dist/graph/physics/physics-controller.cjs +42 -0
- package/dist/graph/physics/physics-controller.d.ts +12 -1
- package/dist/graph/physics/physics-controller.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller.js +41 -0
- package/dist/graph/physics/physics-controller.js.map +1 -1
- package/dist/graph/physics/scenegraph-instance.cjs +7 -0
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-instance.js +8 -0
- package/dist/graph/physics/scenegraph-instance.js.map +1 -1
- package/dist/graph/tables/gpu-table-model.cjs +2 -2
- package/dist/graph/tables/gpu-table-model.d.ts +2 -1
- package/dist/graph/tables/gpu-table-model.d.ts.map +1 -1
- package/dist/graph/tables/gpu-table-model.js +2 -2
- package/dist/graph/tables/gpu-table-model.js.map +1 -1
- package/dist/graph/tables/index.cjs.map +1 -1
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.cjs +126 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts +31 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -0
- package/dist/lighting/ambient-occlusion-pass.js +108 -0
- package/dist/lighting/ambient-occlusion-pass.js.map +1 -0
- package/dist/lighting/clustered-light-grid.cjs +378 -0
- package/dist/lighting/clustered-light-grid.d.ts +94 -0
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -0
- package/dist/lighting/clustered-light-grid.js +370 -0
- package/dist/lighting/clustered-light-grid.js.map +1 -0
- package/dist/lighting/contact-shadow-composite.cjs +80 -0
- package/dist/lighting/contact-shadow-composite.d.ts +6 -0
- package/dist/lighting/contact-shadow-composite.d.ts.map +1 -0
- package/dist/lighting/contact-shadow-composite.js +59 -0
- package/dist/lighting/contact-shadow-composite.js.map +1 -0
- package/dist/lighting/contact-shadow-pass.cjs +102 -0
- package/dist/lighting/contact-shadow-pass.d.ts +23 -0
- package/dist/lighting/contact-shadow-pass.d.ts.map +1 -0
- package/dist/lighting/contact-shadow-pass.js +85 -0
- package/dist/lighting/contact-shadow-pass.js.map +1 -0
- package/dist/lighting/index.cjs +128 -0
- package/dist/lighting/index.cjs.map +6 -0
- package/dist/lighting/index.d.ts +35 -0
- package/dist/lighting/index.d.ts.map +1 -0
- package/dist/lighting/index.js +22 -0
- package/dist/lighting/index.js.map +1 -0
- package/dist/lighting/lightmap-atlas.cjs +246 -0
- package/dist/lighting/lightmap-atlas.d.ts +53 -0
- package/dist/lighting/lightmap-atlas.d.ts.map +1 -0
- package/dist/lighting/lightmap-atlas.js +279 -0
- package/dist/lighting/lightmap-atlas.js.map +1 -0
- package/dist/lighting/lightmap-baker.cjs +238 -0
- package/dist/lighting/lightmap-baker.d.ts +62 -0
- package/dist/lighting/lightmap-baker.d.ts.map +1 -0
- package/dist/lighting/lightmap-baker.js +236 -0
- package/dist/lighting/lightmap-baker.js.map +1 -0
- package/dist/lighting/lightmap-data.cjs +117 -0
- package/dist/lighting/lightmap-data.d.ts +20 -0
- package/dist/lighting/lightmap-data.d.ts.map +1 -0
- package/dist/lighting/lightmap-data.js +110 -0
- package/dist/lighting/lightmap-data.js.map +1 -0
- package/dist/lighting/lightmap-environment.cjs +61 -0
- package/dist/lighting/lightmap-environment.d.ts +18 -0
- package/dist/lighting/lightmap-environment.d.ts.map +1 -0
- package/dist/lighting/lightmap-environment.js +46 -0
- package/dist/lighting/lightmap-environment.js.map +1 -0
- package/dist/lighting/pbr-environment.cjs +45 -0
- package/dist/lighting/pbr-environment.d.ts +25 -0
- package/dist/lighting/pbr-environment.d.ts.map +1 -0
- package/dist/lighting/pbr-environment.js +30 -0
- package/dist/lighting/pbr-environment.js.map +1 -0
- package/dist/lighting/pbr-material.cjs +75 -0
- package/dist/lighting/pbr-material.d.ts +33 -0
- package/dist/lighting/pbr-material.d.ts.map +1 -0
- package/dist/lighting/pbr-material.js +52 -0
- package/dist/lighting/pbr-material.js.map +1 -0
- package/dist/lighting/pbr-model.cjs +579 -0
- package/dist/lighting/pbr-model.d.ts +45 -0
- package/dist/lighting/pbr-model.d.ts.map +1 -0
- package/dist/lighting/pbr-model.js +545 -0
- package/dist/lighting/pbr-model.js.map +1 -0
- package/dist/lighting/pbr-surface-pass.cjs +116 -0
- package/dist/lighting/pbr-surface-pass.d.ts +35 -0
- package/dist/lighting/pbr-surface-pass.d.ts.map +1 -0
- package/dist/lighting/pbr-surface-pass.js +98 -0
- package/dist/lighting/pbr-surface-pass.js.map +1 -0
- package/dist/lighting/prefiltered-environment.cjs +275 -0
- package/dist/lighting/prefiltered-environment.d.ts +56 -0
- package/dist/lighting/prefiltered-environment.d.ts.map +1 -0
- package/dist/lighting/prefiltered-environment.js +264 -0
- package/dist/lighting/prefiltered-environment.js.map +1 -0
- package/dist/lighting/reflection-probe.cjs +321 -0
- package/dist/lighting/reflection-probe.d.ts +77 -0
- package/dist/lighting/reflection-probe.d.ts.map +1 -0
- package/dist/lighting/reflection-probe.js +298 -0
- package/dist/lighting/reflection-probe.js.map +1 -0
- package/dist/lighting/shadow-map-renderer.cjs +631 -0
- package/dist/lighting/shadow-map-renderer.d.ts +92 -0
- package/dist/lighting/shadow-map-renderer.d.ts.map +1 -0
- package/dist/lighting/shadow-map-renderer.js +622 -0
- package/dist/lighting/shadow-map-renderer.js.map +1 -0
- package/dist/lighting/shadow-quality.cjs +58 -0
- package/dist/lighting/shadow-quality.d.ts +13 -0
- package/dist/lighting/shadow-quality.d.ts.map +1 -0
- package/dist/lighting/shadow-quality.js +37 -0
- package/dist/lighting/shadow-quality.js.map +1 -0
- package/dist/material/material.cjs +3 -0
- package/dist/material/material.d.ts +2 -0
- package/dist/material/material.d.ts.map +1 -1
- package/dist/material/material.js +3 -0
- package/dist/material/material.js.map +1 -1
- package/dist/model/gpu-vector-model.cjs +20 -3
- package/dist/model/gpu-vector-model.d.ts +20 -2
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +21 -3
- package/dist/model/gpu-vector-model.js.map +1 -1
- package/dist/models/light-model-utils.cjs +2 -2
- package/dist/models/light-model-utils.d.ts +2 -1
- package/dist/models/light-model-utils.d.ts.map +1 -1
- package/dist/models/light-model-utils.js +2 -2
- package/dist/models/light-model-utils.js.map +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.cjs +121 -0
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts +31 -0
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/punctual-light-controller.js +117 -0
- package/dist/scenegraph/controllers/punctual-light-controller.js.map +1 -0
- package/dist/scenegraph/scene-metadata.cjs +43 -0
- package/dist/scenegraph/scene-metadata.d.ts +9 -0
- package/dist/scenegraph/scene-metadata.d.ts.map +1 -0
- package/dist/scenegraph/scene-metadata.js +21 -0
- package/dist/scenegraph/scene-metadata.js.map +1 -0
- package/dist/scenegraph/scenegraph-interaction.cjs +99 -0
- package/dist/scenegraph/scenegraph-interaction.d.ts +47 -0
- package/dist/scenegraph/scenegraph-interaction.d.ts.map +1 -0
- package/dist/scenegraph/scenegraph-interaction.js +79 -0
- package/dist/scenegraph/scenegraph-interaction.js.map +1 -0
- package/dist/scenegraph/scenegraph-node.cjs +10 -0
- package/dist/scenegraph/scenegraph-node.d.ts +10 -0
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js +10 -0
- package/dist/scenegraph/scenegraph-node.js.map +1 -1
- package/dist/text/experimental.cjs.map +1 -1
- package/dist/text/fonts/atlas/text-utils.cjs +1 -1
- package/dist/text/fonts/atlas/text-utils.js +1 -1
- package/dist/text/fonts/atlas/text-utils.js.map +1 -1
- package/dist/text/fonts/index.cjs.map +1 -1
- package/dist/text/index.cjs +2 -0
- package/dist/text/index.cjs.map +2 -2
- package/dist/text/index.d.ts +1 -1
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +1 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/text-2d/index.cjs +3 -0
- package/dist/text/text-2d/index.d.ts +1 -0
- package/dist/text/text-2d/index.d.ts.map +1 -1
- package/dist/text/text-2d/index.js +1 -0
- package/dist/text/text-2d/index.js.map +1 -1
- package/dist/text/text-2d/model-utils/text-code-point-source.cjs +41 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.d.ts +8 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.js +23 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.js.map +1 -0
- package/dist/text/text-2d/models/text-attribute-model.cjs +4 -1
- package/dist/text/text-2d/models/text-attribute-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-attribute-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-attribute-model.js +6 -1
- package/dist/text/text-2d/models/text-attribute-model.js.map +1 -1
- package/dist/text/text-2d/models/text-dictionary-model.cjs +4 -1
- package/dist/text/text-2d/models/text-dictionary-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-dictionary-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-dictionary-model.js +6 -1
- package/dist/text/text-2d/models/text-dictionary-model.js.map +1 -1
- package/dist/text/text-2d/models/text-storage-model.cjs +4 -1
- package/dist/text/text-2d/models/text-storage-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-storage-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-storage-model.js +6 -1
- package/dist/text/text-2d/models/text-storage-model.js.map +1 -1
- package/licenses/cesium.txt +207 -0
- package/licenses/deck-community.txt +19 -0
- package/licenses/deck.txt +19 -0
- package/licenses/glfx.txt +19 -0
- package/licenses/gltf-loader-ts.txt +21 -0
- package/licenses/magenta-font.txt +13 -0
- package/licenses/nvidia-fxaa.txt +25 -0
- package/licenses/philogl.txt +19 -0
- package/licenses/spark.txt +21 -0
- package/licenses/three.txt +21 -0
- package/package.json +17 -9
- package/src/animation/node-animation-binding.ts +18 -1
- package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.ts +23 -19
- package/src/arrow/renderers/text/renderers/arrow-text-shaders.ts +1 -1
- package/src/compute/computation.ts +1 -1
- package/src/compute/swap.ts +2 -2
- package/src/dynamic-texture/video-texture.ts +9 -3
- package/src/effects/passes/postprocessing/fxaa/fxaa.ts +2 -1
- package/src/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/denoise.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/huesaturation.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/noise.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/sepia.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/vibrance.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/vignette.ts +2 -0
- package/src/gltf/gltf/animations/animations.ts +8 -1
- package/src/gltf/gltf/create-gltf-model.ts +4 -0
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +98 -17
- package/src/gltf/gltf/gltf-billboard.ts +6 -1
- package/src/gltf/gltf/gltf-extension-support.ts +2 -2
- package/src/gltf/index.ts +1 -0
- package/src/gltf/parsers/parse-gltf-animations.ts +22 -8
- package/src/gltf/parsers/parse-gltf-lights.ts +42 -130
- package/src/gltf/parsers/parse-gltf-metadata.ts +40 -0
- package/src/gltf/parsers/parse-gltf.ts +11 -2
- package/src/gltf/parsers/parse-pbr-material.ts +35 -7
- package/src/gltf/pbr/pbr-environment.ts +27 -1
- package/src/gltf/pbr/pbr-material.ts +8 -3
- package/src/gltf/types/gltf-json-schema.ts +1 -0
- package/src/gltf/types/gltf-postprocessed-schema.ts +1 -0
- package/src/graph/models/path/path-attribute-model.ts +10 -1
- package/src/graph/models/path/path-storage-model.ts +10 -1
- package/src/graph/physics/physics-controller.ts +55 -1
- package/src/graph/physics/scenegraph-instance.ts +10 -0
- package/src/graph/tables/gpu-table-model.ts +3 -2
- package/src/index.ts +17 -0
- package/src/lighting/ambient-occlusion-pass.ts +130 -0
- package/src/lighting/clustered-light-grid.ts +481 -0
- package/src/lighting/contact-shadow-composite.ts +67 -0
- package/src/lighting/contact-shadow-pass.ts +107 -0
- package/src/lighting/index.ts +125 -0
- package/src/lighting/lightmap-atlas.ts +348 -0
- package/src/lighting/lightmap-baker.ts +306 -0
- package/src/lighting/lightmap-data.ts +138 -0
- package/src/lighting/lightmap-environment.ts +70 -0
- package/src/lighting/pbr-environment.ts +55 -0
- package/src/lighting/pbr-material.ts +85 -0
- package/src/lighting/pbr-model.ts +608 -0
- package/src/lighting/pbr-surface-pass.ts +122 -0
- package/src/lighting/prefiltered-environment.ts +354 -0
- package/src/lighting/reflection-probe.ts +360 -0
- package/src/lighting/shadow-map-renderer.ts +918 -0
- package/src/lighting/shadow-quality.ts +50 -0
- package/src/material/material.ts +3 -0
- package/src/model/gpu-vector-model.ts +42 -4
- package/src/models/light-model-utils.ts +3 -2
- package/src/scenegraph/controllers/punctual-light-controller.ts +172 -0
- package/src/scenegraph/scene-metadata.ts +23 -0
- package/src/scenegraph/scenegraph-interaction.ts +131 -0
- package/src/scenegraph/scenegraph-node.ts +12 -0
- package/src/splats/README.md +1 -1
- package/src/text/fonts/atlas/text-utils.ts +1 -1
- package/src/text/index.ts +1 -0
- package/src/text/text-2d/index.ts +1 -0
- package/src/text/text-2d/model-utils/text-code-point-source.ts +34 -0
- package/src/text/text-2d/models/text-attribute-model.ts +10 -1
- package/src/text/text-2d/models/text-dictionary-model.ts +10 -1
- package/src/text/text-2d/models/text-storage-model.ts +10 -1
|
@@ -6,7 +6,14 @@ import type {AnimationBinding} from './animation-track';
|
|
|
6
6
|
import type {GroupNode} from '../scenegraph/group-node';
|
|
7
7
|
import {setMorphWeights} from '../scenegraph/controllers/morph-controller';
|
|
8
8
|
|
|
9
|
-
export type NodeAnimationProperty =
|
|
9
|
+
export type NodeAnimationProperty =
|
|
10
|
+
| 'translation'
|
|
11
|
+
| 'rotation'
|
|
12
|
+
| 'scale'
|
|
13
|
+
| 'weights'
|
|
14
|
+
| 'visibility'
|
|
15
|
+
| 'selectable'
|
|
16
|
+
| 'hoverable';
|
|
10
17
|
|
|
11
18
|
/** Bind a property once to a node reference; playback does not resolve asset IDs. */
|
|
12
19
|
export function makeNodeAnimationBinding(
|
|
@@ -28,6 +35,10 @@ export function makeNodeAnimationBinding(
|
|
|
28
35
|
return Array.from((node.userData['morphWeights'] as readonly number[] | undefined) ?? []);
|
|
29
36
|
case 'visibility':
|
|
30
37
|
return [node.display ? 1 : 0];
|
|
38
|
+
case 'selectable':
|
|
39
|
+
return [node.selectable ? 1 : 0];
|
|
40
|
+
case 'hoverable':
|
|
41
|
+
return [node.hoverable ? 1 : 0];
|
|
31
42
|
}
|
|
32
43
|
},
|
|
33
44
|
setValue: value => {
|
|
@@ -44,6 +55,12 @@ export function makeNodeAnimationBinding(
|
|
|
44
55
|
case 'weights':
|
|
45
56
|
setMorphWeights(node, value);
|
|
46
57
|
break;
|
|
58
|
+
case 'selectable':
|
|
59
|
+
node.setProps({selectable: value[0] !== 0});
|
|
60
|
+
break;
|
|
61
|
+
case 'hoverable':
|
|
62
|
+
node.setProps({hoverable: value[0] !== 0});
|
|
63
|
+
break;
|
|
47
64
|
case 'visibility':
|
|
48
65
|
node.setProps({display: value[0] !== 0});
|
|
49
66
|
options.onVisibilityChange?.();
|
|
@@ -65,23 +65,27 @@ export async function makeGPUSplatDataFromGLTFScene(
|
|
|
65
65
|
) {
|
|
66
66
|
throw new Error('Unsupported decoded glTF Gaussian splat primitive');
|
|
67
67
|
}
|
|
68
|
+
const result = descriptor.decoded;
|
|
69
|
+
const table =
|
|
70
|
+
result &&
|
|
71
|
+
typeof result === 'object' &&
|
|
72
|
+
'shape' in result &&
|
|
73
|
+
result.shape === 'arrow-table' &&
|
|
74
|
+
'data' in result
|
|
75
|
+
? result.data
|
|
76
|
+
: result;
|
|
68
77
|
if (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
!('
|
|
72
|
-
!(
|
|
73
|
-
|
|
78
|
+
!table ||
|
|
79
|
+
typeof table !== 'object' ||
|
|
80
|
+
!('batches' in table) ||
|
|
81
|
+
!Array.isArray(table.batches) ||
|
|
82
|
+
!('getChild' in table) ||
|
|
83
|
+
typeof table.getChild !== 'function'
|
|
74
84
|
) {
|
|
75
85
|
throw new Error('Decoded glTF splats require a Mesh Arrow table');
|
|
76
86
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
data: GPUSplatArrowTableLike;
|
|
80
|
-
};
|
|
81
|
-
if (!decoded.data || !Array.isArray(decoded.data.batches)) {
|
|
82
|
-
throw new Error('Decoded glTF splats require a Mesh Arrow table');
|
|
83
|
-
}
|
|
84
|
-
consumedSourceBatches = decoded.data.batches.length;
|
|
87
|
+
const decoded = table as GPUSplatArrowTableLike;
|
|
88
|
+
consumedSourceBatches = decoded.batches.length;
|
|
85
89
|
const declaredFeature = primitive.extensions?.EXT_mesh_features?.featureIds?.find(
|
|
86
90
|
(feature: {attribute?: number}) => feature.attribute !== undefined
|
|
87
91
|
);
|
|
@@ -102,11 +106,11 @@ export async function makeGPUSplatDataFromGLTFScene(
|
|
|
102
106
|
) {
|
|
103
107
|
throw new Error('glTF Gaussian splat feature IDs must be unsigned integers');
|
|
104
108
|
}
|
|
105
|
-
if (values.length !== decoded.
|
|
109
|
+
if (values.length !== decoded.numRows) {
|
|
106
110
|
throw new Error('glTF Gaussian splat feature-ID count does not match decoded splats');
|
|
107
111
|
}
|
|
108
112
|
let offset = 0;
|
|
109
|
-
const recordBatches = decoded.
|
|
113
|
+
const recordBatches = decoded.batches.map(recordBatch => {
|
|
110
114
|
const ids = values.subarray(offset, offset + recordBatch.numRows);
|
|
111
115
|
offset += recordBatch.numRows;
|
|
112
116
|
const vector = makeVector(ids);
|
|
@@ -118,12 +122,12 @@ export async function makeGPUSplatDataFromGLTFScene(
|
|
|
118
122
|
};
|
|
119
123
|
});
|
|
120
124
|
const table = {
|
|
121
|
-
numRows: decoded.
|
|
122
|
-
schema: decoded.
|
|
125
|
+
numRows: decoded.numRows,
|
|
126
|
+
schema: decoded.schema,
|
|
123
127
|
batches: recordBatches,
|
|
124
|
-
getChild: (name: string) => decoded.
|
|
128
|
+
getChild: (name: string) => decoded.getChild(name)
|
|
125
129
|
};
|
|
126
|
-
source =
|
|
130
|
+
source = table;
|
|
127
131
|
}
|
|
128
132
|
batches = makeGPUSplatDataFromArrow(device, source, {
|
|
129
133
|
sourceBatchIndex,
|
|
@@ -47,7 +47,7 @@ export function configureArrowTextShaderAssembler<ShaderAssemblerType extends Sh
|
|
|
47
47
|
return shaderAssembler;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
shaderAssembler.
|
|
50
|
+
shaderAssembler.addShaderInjectionTarget({
|
|
51
51
|
name: 'TEXT_ATTRIBUTE_VERTEX_TRANSFORM',
|
|
52
52
|
stage: 'vertex',
|
|
53
53
|
glsl: {
|
|
@@ -185,7 +185,7 @@ export class Computation {
|
|
|
185
185
|
|
|
186
186
|
const platformInfo = getPlatformInfo(device);
|
|
187
187
|
const resolvedPlugins = resolveShaderPlugins(this.props.plugins, platformInfo.shaderLanguage);
|
|
188
|
-
if (resolvedPlugins.
|
|
188
|
+
if (resolvedPlugins.injectionTargets.length > 0) {
|
|
189
189
|
throw new Error('Computation does not support ShaderPlugin render hooks');
|
|
190
190
|
}
|
|
191
191
|
if (
|
package/src/compute/swap.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import type {BufferProps, FramebufferProps} from '@luma.gl/core';
|
|
6
|
-
import {Device,
|
|
6
|
+
import {Device, DeviceResource, Buffer, Framebuffer, Texture} from '@luma.gl/core';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Helper class for working with repeated transformations / computations
|
|
@@ -11,7 +11,7 @@ import {Device, Resource, Buffer, Framebuffer, Texture} from '@luma.gl/core';
|
|
|
11
11
|
* @note the two resources are expected to be structurally identical (same size, length, format, etc)
|
|
12
12
|
* @note the two resources can be destroyed by calling `destroy()`
|
|
13
13
|
*/
|
|
14
|
-
export class Swap<T extends
|
|
14
|
+
export class Swap<T extends DeviceResource<any>> {
|
|
15
15
|
id: string;
|
|
16
16
|
|
|
17
17
|
/** The current resource - usually the source for renders or computations */
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
Device,
|
|
7
|
+
ExternalTexture,
|
|
8
|
+
DeviceResourceProps,
|
|
9
|
+
Sampler,
|
|
10
|
+
SamplerProps
|
|
11
|
+
} from '@luma.gl/core';
|
|
6
12
|
import {Texture, assert} from '@luma.gl/core';
|
|
7
13
|
import {uid} from '../utils/uid';
|
|
8
14
|
import type {TextureBindingLayout, TextureBindingSource} from '@luma.gl/core/dynamic';
|
|
9
15
|
|
|
10
16
|
/** Properties for a live video binding source. */
|
|
11
|
-
export type VideoTextureProps = Pick<
|
|
17
|
+
export type VideoTextureProps = Pick<DeviceResourceProps, 'id'> & {
|
|
12
18
|
/** Caller-owned live video source followed by this binding source. */
|
|
13
19
|
source: HTMLVideoElement | VideoFrame;
|
|
14
20
|
/** Color space requested for copied or imported video data. */
|
|
@@ -62,7 +68,7 @@ export class VideoTexture implements TextureBindingSource {
|
|
|
62
68
|
return this._updateTimestamp;
|
|
63
69
|
}
|
|
64
70
|
|
|
65
|
-
/**
|
|
71
|
+
/** DeviceResource label used by debug output. */
|
|
66
72
|
get [Symbol.toStringTag]() {
|
|
67
73
|
return 'VideoTexture';
|
|
68
74
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
|
|
4
5
|
|
|
5
6
|
import type {ShaderPass} from '@luma.gl/shaders';
|
|
6
7
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
|
|
5
|
+
// Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
|
|
4
6
|
|
|
5
7
|
import type {ShaderPass} from '@luma.gl/shaders';
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
|
|
5
|
+
// Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
|
|
4
6
|
|
|
5
7
|
import type {ShaderPass} from '@luma.gl/shaders';
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
|
|
5
|
+
// Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
|
|
4
6
|
|
|
5
7
|
import type {ShaderPass} from '@luma.gl/shaders';
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
|
|
5
|
+
// Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
|
|
4
6
|
|
|
5
7
|
import type {ShaderPass} from '@luma.gl/shaders';
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
|
|
5
|
+
// Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
|
|
4
6
|
|
|
5
7
|
import type {ShaderPass} from '@luma.gl/shaders';
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
|
|
5
|
+
// Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
|
|
4
6
|
|
|
5
7
|
import type {ShaderPass} from '@luma.gl/shaders';
|
|
6
8
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
// SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
|
|
5
|
+
// Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
|
|
4
6
|
|
|
5
7
|
import type {ShaderPass} from '@luma.gl/shaders';
|
|
6
8
|
|
|
@@ -13,7 +13,14 @@ export type GLTFAnimation = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/** Supported glTF animation target paths. */
|
|
16
|
-
export type GLTFAnimationPath =
|
|
16
|
+
export type GLTFAnimationPath =
|
|
17
|
+
| 'translation'
|
|
18
|
+
| 'rotation'
|
|
19
|
+
| 'scale'
|
|
20
|
+
| 'weights'
|
|
21
|
+
| 'visibility'
|
|
22
|
+
| 'selectable'
|
|
23
|
+
| 'hoverable';
|
|
17
24
|
|
|
18
25
|
/** Parsed glTF animation channel that targets a scenegraph node. */
|
|
19
26
|
export type GLTFNodeAnimationChannel = {
|
|
@@ -549,6 +549,10 @@ export function createGLTFMaterial(device: Device, options: CreateGLTFMaterialOp
|
|
|
549
549
|
|
|
550
550
|
const pbrMaterialProps = {...options.parsedPPBRMaterial.uniforms};
|
|
551
551
|
delete pbrMaterialProps.camera;
|
|
552
|
+
// Environment controls belong to the scene uniforms of each model, not to the material.
|
|
553
|
+
delete pbrMaterialProps.environmentIntensity;
|
|
554
|
+
delete pbrMaterialProps.environmentRotation;
|
|
555
|
+
delete pbrMaterialProps.environmentMipCount;
|
|
552
556
|
const materialBindings = Object.fromEntries(
|
|
553
557
|
Object.entries({
|
|
554
558
|
...pbrMaterialProps,
|
|
@@ -2,13 +2,24 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import {parseGLTFMetadata} from '../parsers/parse-gltf-metadata';
|
|
5
6
|
import {parseGLTFJointDeclarations} from '../parsers/parse-gltf-joints';
|
|
6
7
|
import {Device} from '@luma.gl/core';
|
|
7
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
GroupNode,
|
|
10
|
+
Material,
|
|
11
|
+
ModelNode,
|
|
12
|
+
JointController,
|
|
13
|
+
BillboardController
|
|
14
|
+
} from '@luma.gl/engine';
|
|
8
15
|
import {GLTFPostprocessed} from '../types/gltf-postprocessed-schema';
|
|
9
16
|
import {Light} from '@luma.gl/shaders';
|
|
10
17
|
import {parseGLTF, type ParseGLTFOptions} from '../parsers/parse-gltf';
|
|
11
|
-
import {
|
|
18
|
+
import {bindGLTFPunctualLights} from '../parsers/parse-gltf-lights';
|
|
19
|
+
import {
|
|
20
|
+
PunctualLightController,
|
|
21
|
+
type PunctualLightDefinition
|
|
22
|
+
} from '../../scenegraph/controllers/punctual-light-controller';
|
|
12
23
|
import {GLTFAnimator} from './gltf-animator';
|
|
13
24
|
import {parseGLTFSkins} from './gltf-skin';
|
|
14
25
|
import {SkinController, MaterialVariants} from '@luma.gl/engine';
|
|
@@ -20,6 +31,7 @@ import {
|
|
|
20
31
|
type GLTFExtensionSupport
|
|
21
32
|
} from './gltf-extension-support';
|
|
22
33
|
import {parseGLTFMaterialVariants} from './gltf-material-variants';
|
|
34
|
+
import {parseGLTFBillboards} from './gltf-billboard';
|
|
23
35
|
|
|
24
36
|
export type GLTFScenegraphBounds = {
|
|
25
37
|
/** World-space axis-aligned bounds for the scene or model. */
|
|
@@ -36,6 +48,10 @@ export type GLTFScenegraphBounds = {
|
|
|
36
48
|
|
|
37
49
|
/** Scenegraph bundle returned from a parsed glTF asset. */
|
|
38
50
|
export type GLTFScenegraphs = {
|
|
51
|
+
/** Opt-in camera-facing scene traversal using resolved runtime node bindings. */
|
|
52
|
+
billboards: BillboardController | null;
|
|
53
|
+
/** Metadata associated with source asset and scene resources. */
|
|
54
|
+
metadata: import('@luma.gl/engine').SceneMetadata;
|
|
39
55
|
/** Shared physical joint declarations, separate from skeletal skinning. */
|
|
40
56
|
joints: JointController;
|
|
41
57
|
jointIssues: {code: string; path: string; message: string}[];
|
|
@@ -53,6 +69,8 @@ export type GLTFScenegraphs = {
|
|
|
53
69
|
animations: GLTFAnimation[];
|
|
54
70
|
/** Parsed punctual lights from the asset. */
|
|
55
71
|
lights: Light[];
|
|
72
|
+
/** Updates punctual lights after programmatic transform or visibility changes. */
|
|
73
|
+
punctualLights: PunctualLightController;
|
|
56
74
|
/** Extensions reported by the asset and whether luma.gl supports them. */
|
|
57
75
|
extensionSupport: Map<string, GLTFExtensionSupport>;
|
|
58
76
|
/** Camera-friendly bounds for each scene in `scenes`, in matching order. */
|
|
@@ -83,10 +101,28 @@ export function createScenegraphsFromGLTF(
|
|
|
83
101
|
gltf: GLTFPostprocessed,
|
|
84
102
|
options?: ParseGLTFOptions
|
|
85
103
|
): GLTFScenegraphs {
|
|
104
|
+
const metadata = parseGLTFMetadata(gltf);
|
|
86
105
|
if (options?.strictExtensions) {
|
|
87
106
|
assertSupportedGLTFExtensions(gltf, device);
|
|
88
107
|
}
|
|
89
108
|
|
|
109
|
+
// Validate the optional profile before parseGLTF allocates models, textures, or buffers.
|
|
110
|
+
if (options?.billboards) {
|
|
111
|
+
const validationNodes = new Map<number, GroupNode>();
|
|
112
|
+
gltf.nodes.forEach((node, index) => {
|
|
113
|
+
if (node.extensions?.['KHR_billboard']) validationNodes.set(index, new GroupNode());
|
|
114
|
+
});
|
|
115
|
+
const validation = new BillboardController(
|
|
116
|
+
parseGLTFBillboards({
|
|
117
|
+
gltf,
|
|
118
|
+
scenes: [],
|
|
119
|
+
gltfNodeIndexToNodeMap: validationNodes,
|
|
120
|
+
allowLegacyYAxis: options.billboards.allowLegacyYAxis
|
|
121
|
+
})
|
|
122
|
+
);
|
|
123
|
+
validation.destroy();
|
|
124
|
+
}
|
|
125
|
+
|
|
90
126
|
const {
|
|
91
127
|
scenes,
|
|
92
128
|
materials,
|
|
@@ -97,14 +133,57 @@ export function createScenegraphsFromGLTF(
|
|
|
97
133
|
materialInstances
|
|
98
134
|
} = parseGLTF(device, gltf, options);
|
|
99
135
|
|
|
136
|
+
const billboards = options?.billboards
|
|
137
|
+
? new BillboardController(
|
|
138
|
+
parseGLTFBillboards({
|
|
139
|
+
gltf,
|
|
140
|
+
scenes,
|
|
141
|
+
gltfNodeIndexToNodeMap,
|
|
142
|
+
allowLegacyYAxis: options.billboards.allowLegacyYAxis
|
|
143
|
+
})
|
|
144
|
+
)
|
|
145
|
+
: null;
|
|
146
|
+
scenes.forEach((scene, index) => {
|
|
147
|
+
const packet = metadata.get('scene', index);
|
|
148
|
+
if (packet) scene.metadata['xmp'] = packet;
|
|
149
|
+
const geometryMetadata = gltf.scenes[index]?.extensions?.['FB_geometry_metadata'];
|
|
150
|
+
if (geometryMetadata) scene.metadata['fb:geometry'] = geometryMetadata;
|
|
151
|
+
});
|
|
152
|
+
const meshPackets = new Map<string, Record<string, unknown>>();
|
|
153
|
+
gltf.meshes.forEach((mesh, index) => {
|
|
154
|
+
const packet = metadata.get('mesh', index);
|
|
155
|
+
if (!packet) return;
|
|
156
|
+
meshPackets.set(mesh.id, packet);
|
|
157
|
+
const group = gltfMeshIdToNodeMap.get(mesh.id);
|
|
158
|
+
if (group) group.metadata['xmp'] = packet;
|
|
159
|
+
});
|
|
160
|
+
gltfNodeIndexToNodeMap.forEach((node, index) => {
|
|
161
|
+
const packet = metadata.get('node', index);
|
|
162
|
+
if (packet) node.metadata['xmp'] = packet;
|
|
163
|
+
if (!meshPackets.size) return;
|
|
164
|
+
const sourceMesh = gltf.nodes[index]?.mesh;
|
|
165
|
+
const meshPacket = sourceMesh && meshPackets.get(sourceMesh.id);
|
|
166
|
+
const mesh = node.userData['gltfMesh'];
|
|
167
|
+
if (meshPacket && mesh instanceof GroupNode) mesh.metadata['xmp'] = meshPacket;
|
|
168
|
+
});
|
|
169
|
+
materials.forEach((material, index) => {
|
|
170
|
+
const packet = metadata.get('material', index);
|
|
171
|
+
if (packet) {
|
|
172
|
+
material.metadata['xmp'] = packet;
|
|
173
|
+
for (const instance of materialInstances.get(index) || []) instance.metadata['xmp'] = packet;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
100
177
|
const jointDeclarations = parseGLTFJointDeclarations(gltf, gltfNodeIndexToNodeMap);
|
|
101
178
|
const joints = new JointController(jointDeclarations.declarations.map(item => item.joint));
|
|
102
179
|
const animations = parseGLTFAnimations(gltf);
|
|
103
180
|
const sourceLights =
|
|
104
|
-
(gltf as GLTFPostprocessed & {lights?:
|
|
105
|
-
(gltf.extensions?.['KHR_lights_punctual']?.['lights'] as
|
|
181
|
+
(gltf as GLTFPostprocessed & {lights?: PunctualLightDefinition[]}).lights ||
|
|
182
|
+
(gltf.extensions?.['KHR_lights_punctual']?.['lights'] as
|
|
183
|
+
| PunctualLightDefinition[]
|
|
184
|
+
| undefined) ||
|
|
106
185
|
[];
|
|
107
|
-
const lightDefinitions = sourceLights.map(light => ({
|
|
186
|
+
const lightDefinitions = sourceLights.map<PunctualLightDefinition>(light => ({
|
|
108
187
|
...light,
|
|
109
188
|
...(Array.isArray(light['color']) ? {color: [...light['color']]} : {}),
|
|
110
189
|
...(light['spot'] ? {spot: {...light['spot']}} : {})
|
|
@@ -119,21 +198,16 @@ export function createScenegraphsFromGLTF(
|
|
|
119
198
|
}
|
|
120
199
|
return runtimeCamera;
|
|
121
200
|
});
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
};
|
|
127
|
-
const lights = parseGLTFLights(gltf, lightOptions);
|
|
128
|
-
const refreshLights = () => {
|
|
129
|
-
lights.splice(0, lights.length, ...parseGLTFLights(gltf, lightOptions));
|
|
130
|
-
};
|
|
201
|
+
const lightBindings = bindGLTFPunctualLights(gltf.nodes, gltfNodeIdToNodeMap, lightDefinitions);
|
|
202
|
+
const punctualLights = new PunctualLightController(lightBindings, options?.useByteColors ?? true);
|
|
203
|
+
const lights = punctualLights.lights;
|
|
204
|
+
const refreshLights = () => punctualLights.update();
|
|
131
205
|
const animator = new GLTFAnimator({
|
|
132
|
-
properties: options?.properties ?? undefined,
|
|
133
206
|
onVisibilityChange: refreshLights,
|
|
207
|
+
onLightChange: refreshLights,
|
|
208
|
+
properties: options?.properties ?? undefined,
|
|
134
209
|
cameras,
|
|
135
210
|
lightDefinitions,
|
|
136
|
-
onLightChange: refreshLights,
|
|
137
211
|
animations,
|
|
138
212
|
gltfNodeIdToNodeMap,
|
|
139
213
|
materials,
|
|
@@ -144,7 +218,10 @@ export function createScenegraphsFromGLTF(
|
|
|
144
218
|
const sceneBounds = scenes.map(scene => getScenegraphBounds(scene.getBounds()));
|
|
145
219
|
const modelBounds = getCombinedScenegraphBounds(sceneBounds);
|
|
146
220
|
const skins = new SkinController(parseGLTFSkins({device, gltf, scenes, gltfNodeIndexToNodeMap}));
|
|
147
|
-
animator.setUpdateHandler(() =>
|
|
221
|
+
animator.setUpdateHandler(() => {
|
|
222
|
+
skins.update();
|
|
223
|
+
if (lightBindings.length) refreshLights();
|
|
224
|
+
});
|
|
148
225
|
|
|
149
226
|
let destroyed = false;
|
|
150
227
|
const destroy = (): void => {
|
|
@@ -153,6 +230,7 @@ export function createScenegraphsFromGLTF(
|
|
|
153
230
|
}
|
|
154
231
|
destroyed = true;
|
|
155
232
|
skins.destroy();
|
|
233
|
+
billboards?.destroy();
|
|
156
234
|
|
|
157
235
|
const groups = new Set<GroupNode>([
|
|
158
236
|
...scenes,
|
|
@@ -195,8 +273,10 @@ export function createScenegraphsFromGLTF(
|
|
|
195
273
|
};
|
|
196
274
|
|
|
197
275
|
return {
|
|
276
|
+
metadata,
|
|
198
277
|
scenes,
|
|
199
278
|
materials,
|
|
279
|
+
billboards,
|
|
200
280
|
variants,
|
|
201
281
|
joints,
|
|
202
282
|
jointIssues: jointDeclarations.issues,
|
|
@@ -204,6 +284,7 @@ export function createScenegraphsFromGLTF(
|
|
|
204
284
|
animator,
|
|
205
285
|
animations,
|
|
206
286
|
lights,
|
|
287
|
+
punctualLights,
|
|
207
288
|
extensionSupport,
|
|
208
289
|
sceneBounds,
|
|
209
290
|
modelBounds,
|
|
@@ -41,7 +41,12 @@ export function parseGLTFBillboards(props: ParseGLTFBillboardsProps): BillboardC
|
|
|
41
41
|
);
|
|
42
42
|
bindings.push({
|
|
43
43
|
node,
|
|
44
|
-
definition: {
|
|
44
|
+
definition: {
|
|
45
|
+
...definition,
|
|
46
|
+
...(definition.viewDirection ? {viewDirection: [...definition.viewDirection]} : {}),
|
|
47
|
+
...(definition.up ? {up: [...definition.up]} : {}),
|
|
48
|
+
rotationAxis: definition.rotationAxis === 'y' ? 'y' : 'all'
|
|
49
|
+
},
|
|
45
50
|
matrixAuthored: Boolean(source.matrix)
|
|
46
51
|
});
|
|
47
52
|
});
|
|
@@ -296,9 +296,9 @@ const GLTF_EXTENSION_SUPPORT_REGISTRY: Record<string, GLTFExtensionSupportDefini
|
|
|
296
296
|
comment: 'Metadata payloads remain in the loaded glTF, but luma.gl does not interpret them.'
|
|
297
297
|
},
|
|
298
298
|
KHR_xmp_json_ld: {
|
|
299
|
-
supportLevel: '
|
|
299
|
+
supportLevel: 'parsed-and-wired',
|
|
300
300
|
standardStatus: 'ratified',
|
|
301
|
-
comment: '
|
|
301
|
+
comment: 'XMP packet references are available through scene metadata.'
|
|
302
302
|
},
|
|
303
303
|
EXT_lights_image_based: {
|
|
304
304
|
supportLevel: 'none',
|
package/src/gltf/index.ts
CHANGED
|
@@ -249,10 +249,21 @@ function parseNodePointerAnimationChannel(
|
|
|
249
249
|
pointerSegments[2] === 'extensions' &&
|
|
250
250
|
pointerSegments[3] === 'KHR_node_visibility' &&
|
|
251
251
|
pointerSegments[4] === 'visible';
|
|
252
|
-
|
|
252
|
+
const isSelectablePointer =
|
|
253
|
+
pointerSegments.length === 5 &&
|
|
254
|
+
pointerSegments[2] === 'extensions' &&
|
|
255
|
+
pointerSegments[3] === 'KHR_node_selectability' &&
|
|
256
|
+
pointerSegments[4] === 'selectable';
|
|
257
|
+
const isHoverablePointer =
|
|
258
|
+
pointerSegments.length === 5 &&
|
|
259
|
+
pointerSegments[2] === 'extensions' &&
|
|
260
|
+
pointerSegments[3] === 'KHR_node_hoverability' &&
|
|
261
|
+
pointerSegments[4] === 'hoverable';
|
|
262
|
+
const isBooleanPointer = isVisibilityPointer || isSelectablePointer || isHoverablePointer;
|
|
263
|
+
if (pointerSegments.length !== 3 && !isBooleanPointer) {
|
|
253
264
|
warnUnsupportedAnimationPointer(
|
|
254
265
|
pointer,
|
|
255
|
-
'node pointers must target transforms, morph weights, or
|
|
266
|
+
'node pointers must target transforms, morph weights, visibility, selectability, or hoverability'
|
|
256
267
|
);
|
|
257
268
|
return null;
|
|
258
269
|
}
|
|
@@ -266,15 +277,18 @@ function parseNodePointerAnimationChannel(
|
|
|
266
277
|
return null;
|
|
267
278
|
}
|
|
268
279
|
|
|
269
|
-
if (
|
|
270
|
-
warnUnsupportedAnimationPointer(
|
|
271
|
-
pointer,
|
|
272
|
-
'boolean visibility animation requires STEP interpolation'
|
|
273
|
-
);
|
|
280
|
+
if (isBooleanPointer && sampler.interpolation !== 'STEP') {
|
|
281
|
+
warnUnsupportedAnimationPointer(pointer, 'boolean node animation requires STEP interpolation');
|
|
274
282
|
return null;
|
|
275
283
|
}
|
|
276
284
|
|
|
277
|
-
const path = isVisibilityPointer
|
|
285
|
+
const path = isVisibilityPointer
|
|
286
|
+
? 'visibility'
|
|
287
|
+
: isSelectablePointer
|
|
288
|
+
? 'selectable'
|
|
289
|
+
: isHoverablePointer
|
|
290
|
+
? 'hoverable'
|
|
291
|
+
: getNodeAnimationPath(pointerSegments[2]);
|
|
278
292
|
if (!path) {
|
|
279
293
|
warnUnsupportedAnimationPointer(
|
|
280
294
|
pointer,
|